From c5f307a330c141c955d4bc99f4675d816b28e223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 13 Oct 2017 13:44:11 +0200 Subject: Some update --- firewall/multiconfig.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'firewall') 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 -- cgit v1.2.3