From d36a2030ea624270a2cffb6a7400de07e6986f09 Mon Sep 17 00:00:00 2001 From: "Roberto C. Sanchez" Date: Tue, 1 Nov 2011 19:55:02 -0400 Subject: [PATCH] Add support for a "status" command to the Debian init scripts --- Shorewall-lite/init.debian.sh | 10 +++++++++- Shorewall/init.debian.sh | 10 +++++++++- Shorewall6-lite/init.debian.sh | 10 +++++++++- Shorewall6/init.debian.sh | 10 +++++++++- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Shorewall-lite/init.debian.sh b/Shorewall-lite/init.debian.sh index 178358a74..4630616b8 100755 --- a/Shorewall-lite/init.debian.sh +++ b/Shorewall-lite/init.debian.sh @@ -109,6 +109,11 @@ shorewall_refresh () { return 0 } +# status of the firewall +shorewall_status () { + $SRWL $SRWL_OPTS status && exit 0 || exit $? +} + case "$1" in start) shorewall_start @@ -122,8 +127,11 @@ case "$1" in force-reload|restart) shorewall_restart ;; + status) + shorewall_status + ;; *) - echo "Usage: /etc/init.d/shorewall-lite {start|stop|refresh|restart|force-reload}" + echo "Usage: /etc/init.d/shorewall-lite {start|stop|refresh|restart|force-reload|status}" exit 1 esac diff --git a/Shorewall/init.debian.sh b/Shorewall/init.debian.sh index dd95f9260..89cae5d17 100755 --- a/Shorewall/init.debian.sh +++ b/Shorewall/init.debian.sh @@ -115,6 +115,11 @@ shorewall_refresh () { return 0 } +# status of the firewall +shorewall_status () { + $SRWL $SRWL_OPTS status && exit 0 || exit $? +} + case "$1" in start) shorewall_start @@ -128,8 +133,11 @@ case "$1" in force-reload|restart) shorewall_restart ;; + status) + shorewall_status + ;; *) - echo "Usage: /etc/init.d/shorewall {start|stop|refresh|restart|force-reload}" + echo "Usage: /etc/init.d/shorewall {start|stop|refresh|restart|force-reload|status}" exit 1 esac diff --git a/Shorewall6-lite/init.debian.sh b/Shorewall6-lite/init.debian.sh index c63a8f704..e3bbab256 100755 --- a/Shorewall6-lite/init.debian.sh +++ b/Shorewall6-lite/init.debian.sh @@ -110,6 +110,11 @@ shorewall6_refresh () { return 0 } +# status of the firewall +shorewall6_status () { + $SRWL $SRWL_OPTS status && exit 0 || exit $? +} + case "$1" in start) shorewall6_start @@ -123,8 +128,11 @@ case "$1" in force-reload|restart) shorewall6_restart ;; + status) + shorewall6_status + ;; *) - echo "Usage: /etc/init.d/shorewall6-lite {start|stop|refresh|restart|force-reload}" + echo "Usage: /etc/init.d/shorewall6-lite {start|stop|refresh|restart|force-reload|status}" exit 1 esac diff --git a/Shorewall6/init.debian.sh b/Shorewall6/init.debian.sh index 6a0e8cb7e..1e1a9d8a9 100755 --- a/Shorewall6/init.debian.sh +++ b/Shorewall6/init.debian.sh @@ -115,6 +115,11 @@ shorewall6_refresh () { return 0 } +# status of the firewall +shorewall6_status () { + $SRWL $SRWL_OPTS status && exit 0 || exit $? +} + case "$1" in start) shorewall6_start @@ -128,8 +133,11 @@ case "$1" in force-reload|restart) shorewall6_restart ;; + status) + shorewall6_status + ;; *) - echo "Usage: /etc/init.d/shorewall6 {start|stop|refresh|restart|force-reload}" + echo "Usage: /etc/init.d/shorewall6 {start|stop|refresh|restart|force-reload|status}" exit 1 esac