Add STARTOPTIONS and RESTARTOPTIONS

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-01-15 20:35:55 -08:00
parent 58bf562747
commit 41e68b59dc
3 changed files with 22 additions and 10 deletions

View File

@ -16,11 +16,23 @@ startup=0
# wait_interface=
#
# Startup options
# Global start/restart/stop options
#
OPTIONS=""
#
# Start options
#
STARTOPTIONS=""
#
# Restart options
#
RESTARTOPTIONS=""
#
# Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf
#

View File

@ -86,7 +86,7 @@ wait_for_pppd () {
shorewall_start () {
echo -n "Starting \"Shorewall firewall\": "
wait_for_pppd
$SRWL $SRWL_OPTS start >> $INITLOG 2>&1 && echo "done." || echo_notdone
$SRWL $SRWL_OPTS start $STARTOPTIONS >> $INITLOG 2>&1 && echo "done." || echo_notdone
return 0
}
@ -104,7 +104,7 @@ shorewall_stop () {
# restart the firewall
shorewall_restart () {
echo -n "Restarting \"Shorewall firewall\": "
$SRWL $SRWL_OPTS restart >> $INITLOG 2>&1 && echo "done." || echo_notdone
$SRWL $SRWL_OPTS restart $RESTARTOPTIONS >> $INITLOG 2>&1 && echo "done." || echo_notdone
return 0
}

View File

@ -74,17 +74,17 @@ export SHOREWALL_INIT_SCRIPT=1
# E X E C U T I O N B E G I N S H E R E #
################################################################################
command="$1"
shift
case "$command" in
start|restart|stop)
exec /sbin/shorewall $OPTIONS $@
start)
exec /sbin/shorewall $OPTIONS start $STARTOPTIONS $@
;;
stop|restart|status)
exec /sbin/shorewall $@
restart|reload)
exec /sbin/shorewall @OPTIONS restart $RESTARTOPTIONS $@
;;
reload)
shift
exec /sbin/shorewall $OPTIONS restart $@
status|stop)
exec /sbin/shorewall @OPTIONS $command $@
;;
*)
usage