forked from extern/shorewall_code
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}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
||||||
|
|
||||||
if [ ! -x $STATEDIR/firewall ]; then
|
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
${SBINDIR}/$PRODUCT compile -c
|
||||||
${SBINDIR}/$PRODUCT compile
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,8 +109,8 @@ shorewall_start () {
|
|||||||
# Run in a sub-shell to avoid name collisions
|
# Run in a sub-shell to avoid name collisions
|
||||||
#
|
#
|
||||||
(
|
(
|
||||||
if ! ${STATE}/$PRODUCT/firewall status > /dev/null 2>&1; then
|
if ! ${STATEDIR}/$PRODUCT/firewall status > /dev/null 2>&1; then
|
||||||
${STATE}/$PRODUCT/firewall stop || echo_notdone
|
${STATEDIR}/$PRODUCT/firewall stop || echo_notdone
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
@ -45,10 +45,9 @@ setstatedir() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
||||||
if [ ! -x "${STATEDIR}/firewall" ]; then
|
|
||||||
if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then
|
if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then
|
||||||
${SBINDIR}/$PRODUCT $OPTIONS compile
|
${SBINDIR}/$PRODUCT $OPTIONS compile -c
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,12 +67,6 @@ start () {
|
|||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
setstatedir
|
setstatedir
|
||||||
|
|
||||||
if [ ! -x "${STATEDIR}/firewall" ]; then
|
|
||||||
if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then
|
|
||||||
${SBINDIR}/$PRODUCT $OPTIONS compile
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x "${STATEDIR}/firewall" ]; then
|
if [ -x "${STATEDIR}/firewall" ]; then
|
||||||
${STATEDIR}/firewall stop 2>&1 | $logger
|
${STATEDIR}/firewall stop 2>&1 | $logger
|
||||||
retval=${PIPESTATUS[0]}
|
retval=${PIPESTATUS[0]}
|
||||||
@ -101,12 +94,6 @@ stop () {
|
|||||||
for PRODUCT in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
setstatedir
|
setstatedir
|
||||||
|
|
||||||
if [ ! -x "${STATEDIR}/firewall" ]; then
|
|
||||||
if [ $PRODUCT == shorewall -o $PRODUCT == shorewall6 ]; then
|
|
||||||
${SBINDIR}/$PRODUCT $OPTIONS compile
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -x "${STATEDIR}/firewall" ]; then
|
if [ -x "${STATEDIR}/firewall" ]; then
|
||||||
${STATEDIR}/firewall clear 2>&1 | $logger
|
${STATEDIR}/firewall clear 2>&1 | $logger
|
||||||
retval=${PIPESTATUS[0]}
|
retval=${PIPESTATUS[0]}
|
||||||
|
@ -66,10 +66,8 @@ setstatedir() {
|
|||||||
|
|
||||||
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
[ -n "$statedir" ] && STATEDIR=${statedir} || STATEDIR=${VARDIR}/${PRODUCT}
|
||||||
|
|
||||||
if [ ! -x $STATEDIR/firewall ]; then
|
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
||||||
if [ $PRODUCT = shorewall -o $PRODUCT = shorewall6 ]; then
|
${SBINDIR}/$PRODUCT compile -c
|
||||||
${SBINDIR}/$PRODUCT compile
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user