From 0e40c5a4a14c542f94f70a71fe773abd3ab45a55 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 30 Nov 2016 15:04:40 -0800 Subject: [PATCH] Shorewall-init changes for unified CLI Signed-off-by: Tom Eastep --- Shorewall-init/ifupdown.debian.sh | 8 +++++--- Shorewall-init/ifupdown.fedora.sh | 8 +++++--- Shorewall-init/ifupdown.suse.sh | 6 ++++-- Shorewall-init/init.debian.sh | 6 ++++-- Shorewall-init/init.fedora.sh | 6 ++++-- Shorewall-init/init.openwrt.sh | 6 ++++-- Shorewall-init/init.suse.sh | 6 ++++-- Shorewall-init/shorewall-init | 6 ++++-- 8 files changed, 34 insertions(+), 18 deletions(-) diff --git a/Shorewall-init/ifupdown.debian.sh b/Shorewall-init/ifupdown.debian.sh index 7c13e8442..bbeede0a6 100644 --- a/Shorewall-init/ifupdown.debian.sh +++ b/Shorewall-init/ifupdown.debian.sh @@ -31,8 +31,10 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT} if [ ! -x $STATEDIR/firewall ]; then - if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT compile + if [ $PRODUCT = shorewall ]; then + ${SBINDIR}/shorewall compile + elif [ $PRODUCT = shorewall6 ]; then + ${SBINDIR}/shorewall -6 compile fi fi } @@ -128,7 +130,7 @@ for PRODUCT in $PRODUCTS; do setstatedir if [ -x $VARLIB/$PRODUCT/firewall ]; then - ( ${VARLIB}/$PRODUCT/firewall -V0 $COMMAND $INTERFACE >> $LOGFILE 2>&1 ) || true + ( ${VARLIB}/$PRODUCT/firewall -V0 $COMMAND $INTERFACE >> $LOGFILE 2>&1 ) || true fi done diff --git a/Shorewall-init/ifupdown.fedora.sh b/Shorewall-init/ifupdown.fedora.sh index 3e37018ac..93533577f 100644 --- a/Shorewall-init/ifupdown.fedora.sh +++ b/Shorewall-init/ifupdown.fedora.sh @@ -33,9 +33,11 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT} - if [ ! -x "$STATEDIR/firewall" ]; then - if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then - ${SBINDIR}/$PRODUCT $OPTIONS compile + if [ ! -x $STATEDIR/firewall ]; then + if [ $PRODUCT = shorewall ]; then + ${SBINDIR}/shorewall compile + elif [ $PRODUCT = shorewall6 ]; then + ${SBINDIR}/shorewall -6 compile fi fi } diff --git a/Shorewall-init/ifupdown.suse.sh b/Shorewall-init/ifupdown.suse.sh index 88ffa9eb6..bff02bab3 100644 --- a/Shorewall-init/ifupdown.suse.sh +++ b/Shorewall-init/ifupdown.suse.sh @@ -31,8 +31,10 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT} if [ ! -x $STATEDIR/firewall ]; then - if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT compile + if [ $PRODUCT = shorewall ]; then + ${SBINDIR}/shorewall compile + elif [ $PRODUCT = shorewall6 ]; then + ${SBINDIR}/shorewall -6 compile fi fi } diff --git a/Shorewall-init/init.debian.sh b/Shorewall-init/init.debian.sh index 50769fc2a..95f5218d0 100755 --- a/Shorewall-init/init.debian.sh +++ b/Shorewall-init/init.debian.sh @@ -73,8 +73,10 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT} - if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT ${OPTIONS} compile -c + if [ $PRODUCT = shorewall ]; then + ${SBINDIR}/shorewall compile + elif [ $PRODUCT = shorewall6 ]; then + ${SBINDIR}/shorewall -6 compile else return 0 fi diff --git a/Shorewall-init/init.fedora.sh b/Shorewall-init/init.fedora.sh index 69ff15f0c..8def2b189 100755 --- a/Shorewall-init/init.fedora.sh +++ b/Shorewall-init/init.fedora.sh @@ -44,8 +44,10 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT} - if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then - ${SBINDIR}/$PRODUCT $OPTIONS compile -c + if [ $PRODUCT = shorewall ]; then + ${SBINDIR}/shorewall compile + elif [ $PRODUCT = shorewall6 ]; then + ${SBINDIR}/shorewall -6 compile else return 0 fi diff --git a/Shorewall-init/init.openwrt.sh b/Shorewall-init/init.openwrt.sh index f48af0c0d..7dbfe4dc6 100644 --- a/Shorewall-init/init.openwrt.sh +++ b/Shorewall-init/init.openwrt.sh @@ -75,8 +75,10 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT} - if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT ${OPTIONS} compile $STATEDIR/firewall + if [ $PRODUCT = shorewall ]; then + ${SBINDIR}/shorewall compile + elif [ $PRODUCT = shorewall6 ]; then + ${SBINDIR}/shorewall -6 compile else return 0 fi diff --git a/Shorewall-init/init.suse.sh b/Shorewall-init/init.suse.sh index 0ebe3246b..0d9570f04 100755 --- a/Shorewall-init/init.suse.sh +++ b/Shorewall-init/init.suse.sh @@ -79,8 +79,10 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT} - if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT ${OPTIONS} compile -c + if [ $PRODUCT = shorewall ]; then + ${SBINDIR}/shorewall compile + elif [ $PRODUCT = shorewall6 ]; then + ${SBINDIR}/shorewall -6 compile else return 0 fi diff --git a/Shorewall-init/shorewall-init b/Shorewall-init/shorewall-init index 33d7cd92a..17c80568e 100644 --- a/Shorewall-init/shorewall-init +++ b/Shorewall-init/shorewall-init @@ -33,8 +33,10 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARLIB}/${PRODUCT} - if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT ${OPTIONS} compile -c + if [ $PRODUCT = shorewall ]; then + ${SBINDIR}/shorewall compile + elif [ $PRODUCT = shorewall6 ]; then + ${SBINDIR}/shorewall -6 compile else return 0 fi