mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-03 12:09:14 +01:00
Revise init.devian.sh handling
This commit is contained in:
parent
9ee0d05507
commit
a8dc934443
@ -13,11 +13,18 @@
|
|||||||
|
|
||||||
|
|
||||||
SRWL=/sbin/shorewall
|
SRWL=/sbin/shorewall
|
||||||
SRWL_OPTS="-v-1"
|
SRWL_OPTS=""
|
||||||
WAIT_FOR_IFUP=/usr/share/shorewall/wait4ifup
|
WAIT_FOR_IFUP=/usr/share/shorewall/wait4ifup
|
||||||
|
# Note, set INITLOG to /dev/null if you do not want to
|
||||||
|
# keep logs of the firewall (not recommended)
|
||||||
|
INITLOG=/dev/null
|
||||||
|
|
||||||
test -x $SRWL || exit 0
|
test -x $SRWL || exit 0
|
||||||
test -x $WAIT_FOR_IFUP || exit 0
|
test -x $WAIT_FOR_IFUP || exit 0
|
||||||
|
test -n $INITLOG || {
|
||||||
|
echo "INITLOG cannot be empty, please configure $0" ;
|
||||||
|
exit 1;
|
||||||
|
}
|
||||||
|
|
||||||
if [ "$(id -u)" != "0" ]
|
if [ "$(id -u)" != "0" ]
|
||||||
then
|
then
|
||||||
@ -26,7 +33,13 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo_notdone () {
|
echo_notdone () {
|
||||||
echo "not done."
|
|
||||||
|
if [ "$INITLOG" = "/dev/null" ] ; then
|
||||||
|
echo "not done."
|
||||||
|
else
|
||||||
|
echo "not done (check $INITLOG)."
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
not_configured () {
|
not_configured () {
|
||||||
@ -70,28 +83,28 @@ wait_for_pppd () {
|
|||||||
shorewall_start () {
|
shorewall_start () {
|
||||||
echo -n "Starting \"Shorewall firewall\": "
|
echo -n "Starting \"Shorewall firewall\": "
|
||||||
wait_for_pppd
|
wait_for_pppd
|
||||||
$SRWL $SRWL_OPTS start && echo "done." || echo_notdone
|
$SRWL $SRWL_OPTS start >> $INITLOG 2>&1 && echo "done." || echo_notdone
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# stop the firewall
|
# stop the firewall
|
||||||
shorewall_stop () {
|
shorewall_stop () {
|
||||||
echo -n "Stopping \"Shorewall firewall\": "
|
echo -n "Stopping \"Shorewall firewall\": "
|
||||||
$SRWL $SRWL_OPTS clear && echo "done." || echo_notdone
|
$SRWL $SRWL_OPTS clear >> $INITLOG 2>&1 && echo "done." || echo_notdone
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# restart the firewall
|
# restart the firewall
|
||||||
shorewall_restart () {
|
shorewall_restart () {
|
||||||
echo -n "Restarting \"Shorewall firewall\": "
|
echo -n "Restarting \"Shorewall firewall\": "
|
||||||
$SRWL $SRWL_OPTS restart && echo "done." || echo_notdone
|
$SRWL $SRWL_OPTS restart >> $INITLOG 2>&1 && echo "done." || echo_notdone
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
# refresh the firewall
|
# refresh the firewall
|
||||||
shorewall_refresh () {
|
shorewall_refresh () {
|
||||||
echo -n "Refreshing \"Shorewall firewall\": "
|
echo -n "Refreshing \"Shorewall firewall\": "
|
||||||
$SRWL $SRWL_OPTS refresh && echo "done." || echo_notdone
|
$SRWL $SRWL_OPTS refresh >> $INITLOG 2>&1 && echo "done." || echo_notdone
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user