Merge pull request #759 from BastilleBSD/shellcheck

Shellcheck
This commit is contained in:
Juan David Hurtado G
2024-12-08 15:13:52 -05:00
committed by GitHub
3 changed files with 10 additions and 10 deletions

View File

@@ -58,7 +58,7 @@ error_notify() {
# Notify message on error and exit
error_exit() {
error_notify $@
error_notify "$@"
exit 1
}

View File

@@ -183,21 +183,21 @@ while [ $# -gt 0 ]; do
jail_port=$3
shift 3
if [ $# -gt 3 ]; then
for last in $@; do
for last in "$@"; do
true
done
if [ $2 == "(" ] && [ $last == ")" ] ; then
check_jail_validity
persist_rdr_log_rule $proto $host_port $jail_port $@
load_rdr_log_rule $proto $host_port $jail_port $@
persist_rdr_log_rule $proto $host_port $jail_port "$@"
load_rdr_log_rule $proto $host_port $jail_port "$@"
shift $#
else
usage
fi
elif [ $# -eq 1 ]; then
check_jail_validity
persist_rdr_log_rule $proto $host_port $jail_port $@
load_rdr_log_rule $proto $host_port $jail_port $@
persist_rdr_log_rule $proto $host_port $jail_port "$@"
load_rdr_log_rule $proto $host_port $jail_port "$@"
shift 1
else
usage

View File

@@ -123,10 +123,10 @@ configure_zfs() {
else
## attempt to determine bastille_zroot from `zpool list`
bastille_zroot=$(zpool list | grep -v NAME | awk '{print $1}')
if [ $(echo "${bastille_zroot}" | wc -l) -gt 1 ]; then
error_notify "Error: Multiple ZFS pools available:\n"${bastille_zroot}""
error_notify "Set desired pool using \"sysrc -f "${bastille_config}" bastille_zfs_zpool=ZPOOL_NAME\""
error_exit "Don't forget to also enable ZFS using \"sysrc -f "${bastille_config}" bastille_zfs_enable=YES\""
if [ "$(echo "${bastille_zroot}" | wc -l)" -gt 1 ]; then
error_notify "Error: Multiple ZFS pools available:\n${bastille_zroot}"
error_notify "Set desired pool using \"sysrc -f ${bastille_config} bastille_zfs_zpool=ZPOOL_NAME\""
error_exit "Don't forget to also enable ZFS using \"sysrc -f ${bastille_config} bastille_zfs_enable=YES\""
fi
sysrc -f "${bastille_config}" bastille_zfs_enable=YES
sysrc -f "${bastille_config}" bastille_zfs_zpool="${bastille_zroot}"