Add STARTOPTIONS and RESTARTOPTIONS

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-01-16 10:03:13 -08:00
parent 58bf562747
commit 25d45dedfc
12 changed files with 72 additions and 43 deletions

View File

@ -18,9 +18,18 @@ startup=0
# #
# Startup options # Startup options
# #
OPTIONS="" OPTIONS=""
#
# Start options
#
STARTOPTIONS=""
#
# Restart options
#
RESTARTOPTIONS=""
# #
# Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf # Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf
# #
@ -30,7 +39,6 @@ INITLOG=/dev/null
# Set this to 1 to cause '/etc/init.d/shorewall-lite stop' to place the firewall in # Set this to 1 to cause '/etc/init.d/shorewall-lite stop' to place the firewall in
# a safe state rather than to open it # a safe state rather than to open it
# #
SAFESTOP=0 SAFESTOP=0
# EOF # EOF

View File

@ -80,7 +80,7 @@ fi
# start the firewall # start the firewall
shorewall_start () { shorewall_start () {
echo -n "Starting \"Shorewall firewall\": " echo -n "Starting \"Shorewall firewall\": "
$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 return 0
} }
@ -98,7 +98,7 @@ shorewall_stop () {
# restart the firewall # restart the firewall
shorewall_restart () { shorewall_restart () {
echo -n "Restarting \"Shorewall firewall\": " 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 return 0
} }

View File

@ -76,14 +76,13 @@ command="$1"
case "$command" in case "$command" in
start) start)
exec /sbin/shorewall-lite $OPTIONS $@ exec /sbin/shorewall-lite $OPTIONS start $STARTOPTIONS $@
;; ;;
stop|restart|status) restart|reload)
exec /sbin/shorewall-lite $@ exec /sbin/shorewall-lite $OPTIONS restart $RESTARTOPTIONS $@
;; ;;
reload) status|stop)
shift exec /sbin/shorewall-lite $OPTIONS $command $@
exec /sbin/shorewall-lite restart $@
;; ;;
*) *)
usage usage

View File

@ -16,11 +16,20 @@ startup=0
# wait_interface= # wait_interface=
# #
# Startup options # Global start/restart/stop options
# #
OPTIONS="" OPTIONS=""
#
# Start options
#
STARTOPTIONS=""
#
# Restart options
#
RESTARTOPTIONS=""
# #
# Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf # Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf
# #
@ -30,7 +39,6 @@ INITLOG=/dev/null
# Set this to 1 to cause '/etc/init.d/shorewall stop' to place the firewall in # Set this to 1 to cause '/etc/init.d/shorewall stop' to place the firewall in
# a safe state rather than to open it # a safe state rather than to open it
# #
SAFESTOP=0 SAFESTOP=0
# EOF # EOF

View File

@ -86,7 +86,7 @@ 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 >> $INITLOG 2>&1 && echo "done." || echo_notdone $SRWL $SRWL_OPTS start $STARTOPTIONS >> $INITLOG 2>&1 && echo "done." || echo_notdone
return 0 return 0
} }
@ -104,7 +104,7 @@ shorewall_stop () {
# restart the firewall # restart the firewall
shorewall_restart () { shorewall_restart () {
echo -n "Restarting \"Shorewall firewall\": " 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 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 # # E X E C U T I O N B E G I N S H E R E #
################################################################################ ################################################################################
command="$1" command="$1"
shift
case "$command" in case "$command" in
start|restart|stop) start)
exec /sbin/shorewall $OPTIONS $@ exec /sbin/shorewall $OPTIONS start $STARTOPTIONS $@
;; ;;
stop|restart|status) restart|reload)
exec /sbin/shorewall $@ exec /sbin/shorewall $OPTIONS restart $RESTARTOPTIONS $@
;; ;;
reload) status|stop)
shift exec /sbin/shorewall $OPTIONS $command $@
exec /sbin/shorewall $OPTIONS restart $@
;; ;;
*) *)
usage usage

View File

@ -18,9 +18,18 @@ startup=0
# #
# Startup options # Startup options
# #
OPTIONS="" OPTIONS=""
#
# Start options
#
STARTOPTIONS=""
#
# Restart options
#
RESTARTOPTIONS=""
# #
# Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf # Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf
# #
@ -30,7 +39,6 @@ INITLOG=/dev/null
# Set this to 1 to cause '/etc/init.d/shorewall6-lite stop' to place the firewall in # Set this to 1 to cause '/etc/init.d/shorewall6-lite stop' to place the firewall in
# a safe state rather than to open it # a safe state rather than to open it
# #
SAFESTOP=0 SAFESTOP=0
# EOF # EOF

View File

@ -81,7 +81,7 @@ fi
# start the firewall # start the firewall
shorewall6_start () { shorewall6_start () {
echo -n "Starting \"Shorewall6 Lite firewall\": " echo -n "Starting \"Shorewall6 Lite firewall\": "
$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 return 0
} }
@ -99,7 +99,7 @@ shorewall6_stop () {
# restart the firewall # restart the firewall
shorewall6_restart () { shorewall6_restart () {
echo -n "Restarting \"Shorewall6 Lite firewall\": " echo -n "Restarting \"Shorewall6 Lite 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 return 0
} }

View File

@ -76,14 +76,13 @@ command="$1"
case "$command" in case "$command" in
start) start)
exec /sbin/shorewall6-lite $OPTIONS $@ exec /sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS $@
;; ;;
stop|restart|status) restart|reload)
exec /sbin/shorewall6-lite $@ exec /sbin/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS $@
;; ;;
reload) status|stop)
shift exec /sbin/shorewall6-lite $OPTIONS $command $@
exec /sbin/shorewall6-lite restart $@
;; ;;
*) *)
usage usage

View File

@ -18,9 +18,18 @@ startup=0
# #
# Startup options # Startup options
# #
OPTIONS="" OPTIONS=""
#
# Start options
#
STARTOPTIONS=""
#
# Restart options
#
RESTARTOPTIONS=""
# #
# Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf # Init Log -- if /dev/null, use the STARTUP_LOG defined in shorewall.conf
# #
@ -30,7 +39,6 @@ INITLOG=/dev/null
# Set this to 1 to cause '/etc/init.d/shorewall6 stop' to place the firewall in # Set this to 1 to cause '/etc/init.d/shorewall6 stop' to place the firewall in
# a safe state rather than to open it # a safe state rather than to open it
# #
SAFESTOP=0 SAFESTOP=0
# EOF # EOF

View File

@ -86,7 +86,7 @@ wait_for_pppd () {
shorewall6_start () { shorewall6_start () {
echo -n "Starting \"Shorewall6 firewall\": " echo -n "Starting \"Shorewall6 firewall\": "
wait_for_pppd 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 return 0
} }
@ -104,7 +104,7 @@ shorewall6_stop () {
# restart the firewall # restart the firewall
shorewall6_restart () { shorewall6_restart () {
echo -n "Restarting \"Shorewall6 firewall\": " echo -n "Restarting \"Shorewall6 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 return 0
} }

View File

@ -76,15 +76,14 @@ export SHOREWALL_INIT_SCRIPT=1
command="$1" command="$1"
case "$command" in case "$command" in
start|restart|stop) start)
exec /sbin/shorewall6 $OPTIONS $@ exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS $@
;; ;;
stop|restart|status) restart|reload)
exec /sbin/shorewall6 $@ exec /sbin/shorewall6 $OPTIONS restart $RESTARTOPTIONS $@
;; ;;
reload) status|stop)
shift exec /sbin/shorewall6 $OPTIONS $command $@
exec /sbin/shorewall6 $OPTIONS restart $@
;; ;;
*) *)
usage usage