From 3c1a2d1b4128eea4bf2bf68b0c8e5f74f226b8e1 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 24 Aug 2013 09:37:56 -0700 Subject: [PATCH] Yet more improvements to Shorewall-init Signed-off-by: Tom Eastep --- Shorewall-init/init.debian.sh | 4 +--- Shorewall-init/init.fedora.sh | 6 ++---- Shorewall-init/init.sh | 10 ++++------ Shorewall-init/init.suse.sh | 2 -- Shorewall-init/shorewall-init | 3 +-- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Shorewall-init/init.debian.sh b/Shorewall-init/init.debian.sh index fc2f95608..330638a9a 100755 --- a/Shorewall-init/init.debian.sh +++ b/Shorewall-init/init.debian.sh @@ -81,8 +81,6 @@ setstatedir() { # . /usr/share/shorewall/shorewallrc -vardir=$VARDIR - # check if shorewall-init is configured or not if [ -f "$SYSCONFDIR/shorewall-init" ] then @@ -129,7 +127,7 @@ shorewall_start () { # Clear the firewall shorewall_stop () { local PRODUCT - local VARDIR + local STATEDIR echo -n "Clearing \"Shorewall-based firewalls\": " for PRODUCT in $PRODUCTS; do diff --git a/Shorewall-init/init.fedora.sh b/Shorewall-init/init.fedora.sh index 12003a251..1cc4480d5 100755 --- a/Shorewall-init/init.fedora.sh +++ b/Shorewall-init/init.fedora.sh @@ -24,8 +24,6 @@ lockfile="/var/lock/subsys/shorewall-init" # Source function library. . /etc/rc.d/init.d/functions -vardir=$VARDIR - # Get startup options (override default) OPTIONS= @@ -56,7 +54,7 @@ setstatedir() { # Initialize the firewall start () { local PRODUCT - local vardir + local STATEDIR if [ -z "$PRODUCTS" ]; then echo "No firewalls configured for shorewall-init" @@ -97,7 +95,7 @@ start () { # Clear the firewall stop () { local PRODUCT - local vardir + local STATEDIR echo -n "Clearing \"Shorewall-based firewalls\": " diff --git a/Shorewall-init/init.sh b/Shorewall-init/init.sh index ac78d6f1f..1326f28e6 100755 --- a/Shorewall-init/init.sh +++ b/Shorewall-init/init.sh @@ -58,8 +58,6 @@ fi # . /usr/share/shorewall/shorewallrc -vardir=$VARDIR - # Locate the current PRODUCT's statedir setstatedir() { local statedir @@ -102,20 +100,20 @@ shorewall_start () { # Clear the firewall shorewall_stop () { local PRODUCT - local VARDIR + local STATEDIR echo -n "Clearing \"Shorewall-based firewalls\": " for PRODUCT in $PRODUCTS; do setstatedir - if [ ! -x ${VARDIR}/firewall ]; then + if [ ! -x ${STATEDIR}/firewall ]; then if [ $PRODUCT = shorewall -o $product = shorewall6 ]; then ${SBINDIR}/$PRODUCT compile fi fi - if [ -x ${VARDIR}/firewall ]; then - ${VARDIR}/firewall clear || exit 1 + if [ -x ${STATEDIR}/firewall ]; then + ${STATEDIR}/firewall clear || exit 1 fi done diff --git a/Shorewall-init/init.suse.sh b/Shorewall-init/init.suse.sh index bb58d8568..7f7134809 100755 --- a/Shorewall-init/init.suse.sh +++ b/Shorewall-init/init.suse.sh @@ -70,8 +70,6 @@ fi # . /usr/share/shorewall/shorewallrc -vardir=$VARDIR - # set the STATEDIR variable setstatedir() { local statedir diff --git a/Shorewall-init/shorewall-init b/Shorewall-init/shorewall-init index bd7086c31..86b15b3f1 100644 --- a/Shorewall-init/shorewall-init +++ b/Shorewall-init/shorewall-init @@ -42,8 +42,6 @@ setstatedir() { # . /usr/share/shorewall/shorewallrc -vardir=$VARDIR - # check if shorewall-init is configured or not if [ -f "$SYSCONFDIR/shorewall-init" ]; then . $SYSCONFDIR/shorewall-init @@ -91,6 +89,7 @@ shorewall_start () { # Clear the firewall shorewall_stop () { local PRODUCT + local STATEDIR echo -n "Clearing \"Shorewall-based firewalls\": " for PRODUCT in $PRODUCTS; do