diff options
Diffstat (limited to 'firewall/multiconfig.sh')
-rwxr-xr-x | firewall/multiconfig.sh | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/firewall/multiconfig.sh b/firewall/multiconfig.sh index 1c9b6ff..0befbf1 100755 --- a/firewall/multiconfig.sh +++ b/firewall/multiconfig.sh @@ -1,10 +1,20 @@ #!/bin/sh set -e +LPATH="$(dirname "$0")" +if [ -f "$LPATH/utils" ]; then + . "$LPATH/utils" +elif [ -f "$LPATH/../utils" ]; then + . "$LPATH/../utils" +else + echo "Can't locate utilities!" + exit 1 +fi +###################################### -mkdir /etc/iptables +mkdir -p /etc/iptables configure() { - if ! grep -q "$3_SAVE=\"/etc/iptables/$1\""; then + if ! grep -q "$3_SAVE=\"/etc/iptables/$1\"" "/etc/conf.d/$2"; then echo "Reconfiguring $2 service configuration" sed -i "s#^$3_SAVE=.*\$#$3_SAVE=\"/etc/iptables/$1\"#" "/etc/conf.d/$2" fi |