mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-20 17:58:07 +02:00
Many fixes for Shorewall-init
Signed-off-by: Tom Eastep <teastep@shorewall.net> Conflicts: Shorewall-init/ifupdown.sh Shorewall-lite/shorewall-lite Shorewall6-lite/shorewall6-lite Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
5ec35bcdc2
commit
6f1cbe45c0
@ -84,7 +84,20 @@ shorewall_start () {
|
|||||||
VARDIR=/var/lib/$product
|
VARDIR=/var/lib/$product
|
||||||
[ -f /etc/$product/vardir ] && . /etc/$product/vardir
|
[ -f /etc/$product/vardir ] && . /etc/$product/vardir
|
||||||
if [ -x ${VARDIR}/firewall ]; then
|
if [ -x ${VARDIR}/firewall ]; then
|
||||||
${VARDIR}/firewall stop || echo_notdone
|
#
|
||||||
|
# Run in a sub-shell to avoid name collisions
|
||||||
|
#
|
||||||
|
(
|
||||||
|
. /usr/share/$product/lib.base
|
||||||
|
#
|
||||||
|
# Get mutex so the firewall state is stable
|
||||||
|
#
|
||||||
|
mutex_on
|
||||||
|
if ! ${VARDIR}/firewall status > /dev/null 2>&1; then
|
||||||
|
${VARDIR}/firewall stop || echo_notdone
|
||||||
|
fi
|
||||||
|
mutex_off
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -103,7 +116,11 @@ shorewall_stop () {
|
|||||||
VARDIR=/var/lib/$product
|
VARDIR=/var/lib/$product
|
||||||
[ -f /etc/$product/vardir ] && . /etc/$product/vardir
|
[ -f /etc/$product/vardir ] && . /etc/$product/vardir
|
||||||
if [ -x ${VARDIR}/firewall ]; then
|
if [ -x ${VARDIR}/firewall ]; then
|
||||||
${VARDIR}/firewall clear || echo_notdone
|
( . /usr/share/$product/lib.base
|
||||||
|
mutex_on
|
||||||
|
${VARDIR}/firewall clear || echo_notdone
|
||||||
|
mutex_off
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -55,15 +55,17 @@ fi
|
|||||||
|
|
||||||
# Initialize the firewall
|
# Initialize the firewall
|
||||||
shorewall_start () {
|
shorewall_start () {
|
||||||
local product
|
local PRODUCT
|
||||||
local vardir
|
local VARDIR
|
||||||
|
|
||||||
echo -n "Initializing \"Shorewall-based firewalls\": "
|
echo -n "Initializing \"Shorewall-based firewalls\": "
|
||||||
for product in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
vardir=/var/lib/$product
|
VARDIR=/var/lib/$PRODUCT
|
||||||
[ -f /etc/$product/vardir ] && . /etc/$product/vardir
|
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
|
||||||
if [ -x ${vardir}/firewall ]; then
|
if [ -x ${VARDIR}/firewall ]; then
|
||||||
${vardir}/firewall stop || exit 1
|
if ! /sbin/$PRODUCT status > /dev/null 2>&1; then
|
||||||
|
${VARDIR}/firewall stop || echo_notdone
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -72,15 +74,15 @@ shorewall_start () {
|
|||||||
|
|
||||||
# Clear the firewall
|
# Clear the firewall
|
||||||
shorewall_stop () {
|
shorewall_stop () {
|
||||||
local product
|
local PRODUCT
|
||||||
local vardir
|
local VARDIR
|
||||||
|
|
||||||
echo -n "Clearing \"Shorewall-based firewalls\": "
|
echo -n "Clearing \"Shorewall-based firewalls\": "
|
||||||
for product in $PRODUCTS; do
|
for PRODUCT in $PRODUCTS; do
|
||||||
vardir=/var/lib/$PRODUCT
|
VARDIR=/var/lib/$PRODUCT
|
||||||
[ -f /etc/$product/vardir ] && . /etc/$product/vardir
|
[ -f /etc/$PRODUCT/vardir ] && . /etc/$PRODUCT/vardir
|
||||||
if [ -x ${vardir}/firewall ]; then
|
if [ -x ${VARDIR}/firewall ]; then
|
||||||
${vardir}/firewall clear || exit 1
|
${VARDIR}/firewall clear || exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user