forked from extern/shorewall_code
Make Shorewall-init obey OPTIONS setting.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
9125a04c45
commit
4c6b3e6596
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user