diff options
author | Karel Kočí <cynerd@email.cz> | 2017-10-13 13:44:11 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-10-13 13:44:11 +0200 |
commit | c5f307a330c141c955d4bc99f4675d816b28e223 (patch) | |
tree | 35f76c615cdd9c1349e52e198dd330edd4051298 /firewall | |
parent | 496fad1b1059118900d8450ce400330c65116497 (diff) | |
download | multiconfig-c5f307a330c141c955d4bc99f4675d816b28e223.tar.gz multiconfig-c5f307a330c141c955d4bc99f4675d816b28e223.tar.bz2 multiconfig-c5f307a330c141c955d4bc99f4675d816b28e223.zip |
Some update
Diffstat (limited to 'firewall')
-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 |