From 34f3076c6df902f736c0aeb0e5795e7c149c6c57 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Fri, 10 May 2013 20:21:00 -0700 Subject: [PATCH] Remove duplicate logic and correct one defect. Signed-off-by: Tom Eastep --- Shorewall-init/init.debian.sh | 10 ++++------ Shorewall-init/init.fedora.sh | 19 +++---------------- Shorewall-init/init.suse.sh | 6 ++---- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/Shorewall-init/init.debian.sh b/Shorewall-init/init.debian.sh index ca7dffd15..cf0a9cc9a 100755 --- a/Shorewall-init/init.debian.sh +++ b/Shorewall-init/init.debian.sh @@ -71,10 +71,8 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT} - if [ ! -x $STATEDIR/firewall ]; then - if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT compile - fi + if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then + ${SBINDIR}/$PRODUCT compile -c fi } @@ -111,8 +109,8 @@ shorewall_start () { # Run in a sub-shell to avoid name collisions # ( - if ! ${STATE}/$PRODUCT/firewall status > /dev/null 2>&1; then - ${STATE}/$PRODUCT/firewall stop || echo_notdone + if ! ${STATEDIR}/$PRODUCT/firewall status > /dev/null 2>&1; then + ${STATEDIR}/$PRODUCT/firewall stop || echo_notdone fi ) fi diff --git a/Shorewall-init/init.fedora.sh b/Shorewall-init/init.fedora.sh index c716a4d00..86c97fe51 100755 --- a/Shorewall-init/init.fedora.sh +++ b/Shorewall-init/init.fedora.sh @@ -45,10 +45,9 @@ setstatedir() { fi [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT} - if [ ! -x "${STATEDIR}/firewall" ]; then - if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then - ${SBINDIR}/$PRODUCT $OPTIONS compile - fi + + if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then + ${SBINDIR}/$PRODUCT $OPTIONS compile -c fi } @@ -68,12 +67,6 @@ start () { for PRODUCT in $PRODUCTS; do setstatedir - if [ ! -x "${STATEDIR}/firewall" ]; then - if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then - ${SBINDIR}/$PRODUCT $OPTIONS compile - fi - fi - if [ -x "${STATEDIR}/firewall" ]; then ${STATEDIR}/firewall stop 2>&1 | $logger retval=${PIPESTATUS[0]} @@ -101,12 +94,6 @@ stop () { for PRODUCT in $PRODUCTS; do setstatedir - if [ ! -x "${STATEDIR}/firewall" ]; then - if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then - ${SBINDIR}/$PRODUCT $OPTIONS compile - fi - fi - if [ -x "${STATEDIR}/firewall" ]; then ${STATEDIR}/firewall clear 2>&1 | $logger retval=${PIPESTATUS[0]} diff --git a/Shorewall-init/init.suse.sh b/Shorewall-init/init.suse.sh index 56ab96496..f1a2a960b 100755 --- a/Shorewall-init/init.suse.sh +++ b/Shorewall-init/init.suse.sh @@ -66,10 +66,8 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT} - if [ ! -x $STATEDIR/firewall ]; then - if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT compile - fi + if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then + ${SBINDIR}/$PRODUCT compile -c fi }