mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 06:10:42 +01:00
Remove duplicate logic and correct one defect.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
c3901f1161
commit
34f3076c6d
@ -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
|
||||
|
@ -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]}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user