aboutsummaryrefslogtreecommitdiff
path: root/firewall
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-10-13 13:44:11 +0200
committerKarel Kočí <cynerd@email.cz>2017-10-13 13:44:11 +0200
commitc5f307a330c141c955d4bc99f4675d816b28e223 (patch)
tree35f76c615cdd9c1349e52e198dd330edd4051298 /firewall
parent496fad1b1059118900d8450ce400330c65116497 (diff)
downloadmulticonfig-c5f307a330c141c955d4bc99f4675d816b28e223.tar.gz
multiconfig-c5f307a330c141c955d4bc99f4675d816b28e223.tar.bz2
multiconfig-c5f307a330c141c955d4bc99f4675d816b28e223.zip
Some update
Diffstat (limited to 'firewall')
-rwxr-xr-xfirewall/multiconfig.sh14
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