Remove duplicate logic and correct one defect.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-05-10 20:21:00 -07:00
parent c3901f1161
commit 34f3076c6d
3 changed files with 9 additions and 26 deletions

View File

@ -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

View File

@ -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]}

View File

@ -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
}