From 25d45dedfc3030c975df9e922960e6e79d9bde02 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 16 Jan 2012 10:03:13 -0800 Subject: [PATCH] Add STARTOPTIONS and RESTARTOPTIONS Signed-off-by: Tom Eastep --- Shorewall-lite/default.debian | 12 ++++++++++-- Shorewall-lite/init.debian.sh | 4 ++-- Shorewall-lite/init.sh | 11 +++++------ Shorewall/default.debian | 14 +++++++++++--- Shorewall/init.debian.sh | 4 ++-- Shorewall/init.sh | 14 +++++++------- Shorewall6-lite/default.debian | 12 ++++++++++-- Shorewall6-lite/init.debian.sh | 4 ++-- Shorewall6-lite/init.sh | 11 +++++------ Shorewall6/default.debian | 12 ++++++++++-- Shorewall6/init.debian.sh | 4 ++-- Shorewall6/init.sh | 13 ++++++------- 12 files changed, 72 insertions(+), 43 deletions(-) diff --git a/Shorewall-lite/default.debian b/Shorewall-lite/default.debian index d9a1639e7..31e905c6a 100644 --- a/Shorewall-lite/default.debian +++ b/Shorewall-lite/default.debian @@ -18,9 +18,18 @@ startup=0 # # Startup options # - OPTIONS="" +# +# Start options +# +STARTOPTIONS="" + +# +# Restart options +# +RESTARTOPTIONS="" + # # 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 # a safe state rather than to open it # - SAFESTOP=0 # EOF diff --git a/Shorewall-lite/init.debian.sh b/Shorewall-lite/init.debian.sh index 4630616b8..f96319b3b 100755 --- a/Shorewall-lite/init.debian.sh +++ b/Shorewall-lite/init.debian.sh @@ -80,7 +80,7 @@ fi # start the firewall shorewall_start () { 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 } @@ -98,7 +98,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 } diff --git a/Shorewall-lite/init.sh b/Shorewall-lite/init.sh index 4d1f91740..214bf710a 100755 --- a/Shorewall-lite/init.sh +++ b/Shorewall-lite/init.sh @@ -76,14 +76,13 @@ command="$1" case "$command" in start) - exec /sbin/shorewall-lite $OPTIONS $@ + exec /sbin/shorewall-lite $OPTIONS start $STARTOPTIONS $@ ;; - stop|restart|status) - exec /sbin/shorewall-lite $@ + restart|reload) + exec /sbin/shorewall-lite $OPTIONS restart $RESTARTOPTIONS $@ ;; - reload) - shift - exec /sbin/shorewall-lite restart $@ + status|stop) + exec /sbin/shorewall-lite $OPTIONS $command $@ ;; *) usage diff --git a/Shorewall/default.debian b/Shorewall/default.debian index 867221952..04e0ef429 100644 --- a/Shorewall/default.debian +++ b/Shorewall/default.debian @@ -16,11 +16,20 @@ 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 # @@ -30,7 +39,6 @@ INITLOG=/dev/null # Set this to 1 to cause '/etc/init.d/shorewall stop' to place the firewall in # a safe state rather than to open it # - SAFESTOP=0 # EOF diff --git a/Shorewall/init.debian.sh b/Shorewall/init.debian.sh index 89cae5d17..53b099139 100755 --- a/Shorewall/init.debian.sh +++ b/Shorewall/init.debian.sh @@ -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 } diff --git a/Shorewall/init.sh b/Shorewall/init.sh index 2a4010535..aaed5d967 100755 --- a/Shorewall/init.sh +++ b/Shorewall/init.sh @@ -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 diff --git a/Shorewall6-lite/default.debian b/Shorewall6-lite/default.debian index 437fbecd8..30416151a 100644 --- a/Shorewall6-lite/default.debian +++ b/Shorewall6-lite/default.debian @@ -18,9 +18,18 @@ startup=0 # # Startup options # - OPTIONS="" +# +# Start options +# +STARTOPTIONS="" + +# +# Restart options +# +RESTARTOPTIONS="" + # # 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 # a safe state rather than to open it # - SAFESTOP=0 # EOF diff --git a/Shorewall6-lite/init.debian.sh b/Shorewall6-lite/init.debian.sh index e3bbab256..e387fc25d 100755 --- a/Shorewall6-lite/init.debian.sh +++ b/Shorewall6-lite/init.debian.sh @@ -81,7 +81,7 @@ fi # start the firewall shorewall6_start () { 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 } @@ -99,7 +99,7 @@ shorewall6_stop () { # restart the firewall shorewall6_restart () { 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 } diff --git a/Shorewall6-lite/init.sh b/Shorewall6-lite/init.sh index 2fab7296d..08dd7922f 100755 --- a/Shorewall6-lite/init.sh +++ b/Shorewall6-lite/init.sh @@ -76,14 +76,13 @@ command="$1" case "$command" in start) - exec /sbin/shorewall6-lite $OPTIONS $@ + exec /sbin/shorewall6-lite $OPTIONS start $STARTOPTIONS $@ ;; - stop|restart|status) - exec /sbin/shorewall6-lite $@ + restart|reload) + exec /sbin/shorewall6-lite $OPTIONS restart $RESTARTOPTIONS $@ ;; - reload) - shift - exec /sbin/shorewall6-lite restart $@ + status|stop) + exec /sbin/shorewall6-lite $OPTIONS $command $@ ;; *) usage diff --git a/Shorewall6/default.debian b/Shorewall6/default.debian index ce9457724..1a8323861 100644 --- a/Shorewall6/default.debian +++ b/Shorewall6/default.debian @@ -18,9 +18,18 @@ startup=0 # # Startup options # - OPTIONS="" +# +# Start options +# +STARTOPTIONS="" + +# +# Restart options +# +RESTARTOPTIONS="" + # # 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 # a safe state rather than to open it # - SAFESTOP=0 # EOF diff --git a/Shorewall6/init.debian.sh b/Shorewall6/init.debian.sh index 1d74bf340..dc8a0874c 100755 --- a/Shorewall6/init.debian.sh +++ b/Shorewall6/init.debian.sh @@ -86,7 +86,7 @@ wait_for_pppd () { shorewall6_start () { echo -n "Starting \"Shorewall6 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 @@ shorewall6_stop () { # restart the firewall shorewall6_restart () { 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 } diff --git a/Shorewall6/init.sh b/Shorewall6/init.sh index 47d66de11..a0d4f9040 100755 --- a/Shorewall6/init.sh +++ b/Shorewall6/init.sh @@ -76,15 +76,14 @@ export SHOREWALL_INIT_SCRIPT=1 command="$1" case "$command" in - start|restart|stop) - exec /sbin/shorewall6 $OPTIONS $@ + start) + exec /sbin/shorewall6 $OPTIONS start $STARTOPTIONS $@ ;; - stop|restart|status) - exec /sbin/shorewall6 $@ + restart|reload) + exec /sbin/shorewall6 $OPTIONS restart $RESTARTOPTIONS $@ ;; - reload) - shift - exec /sbin/shorewall6 $OPTIONS restart $@ + status|stop) + exec /sbin/shorewall6 $OPTIONS $command $@ ;; *) usage