set_hostname() {
# ${1} HOSTNAME value
- [ -r /etc/hostname ] && export HOSTNAME1="$( cat /etc/hostname )"
+ [ -r /etc/hostname ] && HOSTNAME1="$( cat /etc/hostname )" && export HOSTNAME1
if [ -n "${1}" ]
then
check_tz() {
# On installation timezone can be set by symlink and not by the
# TIMEZONE key in rc.conf. In that case follow the symlink.
- if [ $(realpath /etc/localtime | cut -d / -f 1,2,3,4) = "/usr/share/zoneinfo" ]; then
- export TIMEZONE=$(realpath /etc/localtime | cut -d / -f 5,6)
+ if [ "$(realpath /etc/localtime | cut -d / -f 1,2,3,4)" = "/usr/share/zoneinfo" ]; then
+ TIMEZONE="$(realpath /etc/localtime | cut -d / -f 5,6)"
+ export TIMEZONE
fi
}
+# shellcheck disable=SC1091
. /etc/rc.conf
check_tz
66-yeller %g "Please re-enable the boot@system service
for the changes to take effect by running (as root):
-'66-enable -F -t boot boot@system'" %n
\ No newline at end of file
+'66-enable -F -t boot boot@system' " %n
\ No newline at end of file
detect_swapfile() {
# Finds swap references in /etc/fstab.
- export swapfile_detected="$(awk '!/^(#)/' /etc/fstab | awk '$3=="swap" ' | wc -l )"
+ swapfile_detected="$(awk '!/^(#)/' /etc/fstab | awk '$3=="swap" ' | wc -l )"
+ export swapfile_detected
}
detect_util() {
detect_fs adaptec_raid_member
detect_fs jmicron_raid_member
-#SC2154
+# shellcheck disable=SC2154
dmraid_detected=$((ddf_raid_member_detected+isw_raid_member_detected\
+lsi_mega_raid_member_detected+via_raid_member_detected\
+silicon_medley_raid_member_detected+nvidia_raid_member_detected\
detect_util swap_util swapon
# Finally detect and apply the configuration
+# shellcheck disable=SC2154
check_and_apply_conf "$btrfs_detected" "$btrfs_util_exists" BTRFS BTRFS btrfs "[btrfs_progs]"
+# shellcheck disable=SC2154
check_and_apply_conf "$zfs_detected" "$zfs_util_exists" ZFS ZFS zfs "[zfs]"
+# shellcheck disable=SC2154
check_and_apply_conf_zpool "$zfs_detected" "$zfs_util_exists" ZFS
+# shellcheck disable=SC2154
check_and_apply_conf "$crypto_LUKS_detected" "$luks_util_exists" CRYPTTAB LUKS cryptsetup "[cryptsetup]"
+# shellcheck disable=SC2154
check_and_apply_conf "$LVM2_member_detected" "$lvm_util_exists" LVM LVM lvchange "[lvm2]"
+# shellcheck disable=SC2154
check_and_apply_conf "$dmraid_detected" "$dmraid_util_exists" DMRAID DMRAID dmraid "[dmraid]"
+# shellcheck disable=SC2154
check_and_apply_conf "$swap_detected" "$swap_util_exists" SWAP SWAP swapon "[util-linux]"