From 4c6b3e659696961fa2a46d344f7c15043eea7a6c Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 9 Sep 2013 07:33:08 -0700 Subject: [PATCH] Make Shorewall-init obey OPTIONS setting. Signed-off-by: Tom Eastep --- Shorewall-init/init.debian.sh | 6 +++--- Shorewall-init/init.fedora.sh | 4 ++-- Shorewall-init/init.sh | 12 +++--------- Shorewall-init/init.suse.sh | 6 +++--- Shorewall-init/install.sh | 1 + Shorewall-init/shorewall-init | 6 +++--- 6 files changed, 15 insertions(+), 20 deletions(-) diff --git a/Shorewall-init/init.debian.sh b/Shorewall-init/init.debian.sh index 330638a9a..3c71cec04 100755 --- a/Shorewall-init/init.debian.sh +++ b/Shorewall-init/init.debian.sh @@ -72,7 +72,7 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT} if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT compile -c || echo_notdone + ${SBINDIR}/$PRODUCT ${OPTIONS} compile -c || echo_notdone fi } @@ -109,7 +109,7 @@ shorewall_start () { # ( if ! ${STATEDIR}/$PRODUCT/firewall status > /dev/null 2>&1; then - ${STATEDIR}/$PRODUCT/firewall stop || echo_notdone + ${STATEDIR}/$PRODUCT/firewall ${OPTIONS} stop || echo_notdone else echo_notdone fi @@ -134,7 +134,7 @@ shorewall_stop () { setstatedir if [ -x ${STATEDIR}/$PRODUCT/firewall ]; then - ${STATEDIR}/$PRODUCT/firewall clear || echo_notdone + ${STATEDIR}/$PRODUCT/firewall ${OPTIONS} clear || echo_notdone fi done diff --git a/Shorewall-init/init.fedora.sh b/Shorewall-init/init.fedora.sh index 1cc4480d5..53924af2d 100755 --- a/Shorewall-init/init.fedora.sh +++ b/Shorewall-init/init.fedora.sh @@ -70,7 +70,7 @@ start () { if [ $retval -eq 0 ]; then if [ -x "${STATEDIR}/firewall" ]; then - ${STATEDIR}/firewall stop 2>&1 | $logger + ${STATEDIR}/firewall ${OPTIONS} stop 2>&1 | $logger retval=${PIPESTATUS[0]} [ $retval -ne 0 ] && break else @@ -105,7 +105,7 @@ stop () { if [ $retval -eq 0 ]; then if [ -x "${STATEDIR}/firewall" ]; then - ${STATEDIR}/firewall clear 2>&1 | $logger + ${STATEDIR}/firewall ${OPTIONS} clear 2>&1 | $logger retval=${PIPESTATUS[0]} [ $retval -ne 0 ] && break else diff --git a/Shorewall-init/init.sh b/Shorewall-init/init.sh index 1326f28e6..67920742a 100755 --- a/Shorewall-init/init.sh +++ b/Shorewall-init/init.sh @@ -69,7 +69,7 @@ setstatedir() { if [ ! -x $STATEDIR/firewall ]; then if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT compile $STATEDIR/firewall + ${SBINDIR}/$PRODUCT ${OPTIONS} compile $STATEDIR/firewall fi fi } @@ -85,7 +85,7 @@ shorewall_start () { if [ -x ${STATEDIR}/firewall ]; then if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then - ${STATEDIR}/firewall stop || exit 1 + ${STATEDIR}/firewall ${OPTIONS} stop || exit 1 fi fi done @@ -106,14 +106,8 @@ shorewall_stop () { for PRODUCT in $PRODUCTS; do setstatedir - if [ ! -x ${STATEDIR}/firewall ]; then - if [ $PRODUCT = shorewall -o $product = shorewall6 ]; then - ${SBINDIR}/$PRODUCT compile - fi - fi - if [ -x ${STATEDIR}/firewall ]; then - ${STATEDIR}/firewall clear || exit 1 + ${STATEDIR}/firewall ${OPTIONS} clear || exit 1 fi done diff --git a/Shorewall-init/init.suse.sh b/Shorewall-init/init.suse.sh index 7f7134809..a7795d53b 100755 --- a/Shorewall-init/init.suse.sh +++ b/Shorewall-init/init.suse.sh @@ -80,7 +80,7 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT} if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT compile -c || exit + ${SBINDIR}/$PRODUCT ${OPTIONS} compile -c || exit fi } @@ -95,7 +95,7 @@ shorewall_start () { if [ -x $STATEDIR/firewall ]; then if ! ${SBIN}/$PRODUCT status > /dev/null 2>&1; then - $STATEDIR/$PRODUCT/firewall stop || exit + $STATEDIR/$PRODUCT/firewall ${OPTIONS} stop || exit fi else exit 6 @@ -117,7 +117,7 @@ shorewall_stop () { setstatedir if [ -x ${STATEDIR}/firewall ]; then - ${STATEDIR}/firewall clear || exit + ${STATEDIR}/firewall ${OPTIONS} clear || exit else exit 6 fi diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 1658faa31..e7e1051c2 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -317,6 +317,7 @@ if [ -n "$SYSTEMD" ]; then chmod 755 ${DESTDIR}${SBINDIR} fi run_install $OWNERSHIP -m 700 shorewall-init ${DESTDIR}${SBINDIR}/shorewall-init + [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/shorewall-init echo "CLI installed as ${DESTDIR}${SBINDIR}/shorewall-init" fi diff --git a/Shorewall-init/shorewall-init b/Shorewall-init/shorewall-init index 5f093005b..7b5d4ba38 100644 --- a/Shorewall-init/shorewall-init +++ b/Shorewall-init/shorewall-init @@ -33,7 +33,7 @@ setstatedir() { [ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT} if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then - ${SBINDIR}/$PRODUCT compile -c || exit 1 + ${SBINDIR}/$PRODUCT ${OPTIONS} compile -c || exit 1 fi } @@ -69,7 +69,7 @@ shorewall_start () { # ( if ! ${STATEDIR}/$PRODUCT/firewall status > /dev/null 2>&1; then - ${STATEDIR}/$PRODUCT/firewall stop || exit 1 + ${STATEDIR}/$PRODUCT/firewall ${OPTIONS} stop || exit 1 else exit 1 fi @@ -96,7 +96,7 @@ shorewall_stop () { setstatedir if [ -x ${STATEDIR}/$PRODUCT/firewall ]; then - ${STATEDIR}/$PRODUCT/firewall clear || exit 1 + ${STATEDIR}/$PRODUCT/firewall ${OPTIONS} clear || exit 1 fi done