Add support for a "status" command to the Debian init scripts

(cherry picked from commit d36a2030ea)
This commit is contained in:
Roberto C. Sanchez 2011-11-01 19:55:02 -04:00
parent 0a605c63f2
commit cf8c30904d
4 changed files with 36 additions and 4 deletions

View File

@ -109,6 +109,11 @@ shorewall_refresh () {
return 0 return 0
} }
# status of the firewall
shorewall_status () {
$SRWL $SRWL_OPTS status && exit 0 || exit $?
}
case "$1" in case "$1" in
start) start)
shorewall_start shorewall_start
@ -122,8 +127,11 @@ case "$1" in
force-reload|restart) force-reload|restart)
shorewall_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 exit 1
esac esac

View File

@ -115,6 +115,11 @@ shorewall_refresh () {
return 0 return 0
} }
# status of the firewall
shorewall_status () {
$SRWL $SRWL_OPTS status && exit 0 || exit $?
}
case "$1" in case "$1" in
start) start)
shorewall_start shorewall_start
@ -128,8 +133,11 @@ case "$1" in
force-reload|restart) force-reload|restart)
shorewall_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 exit 1
esac esac

View File

@ -110,6 +110,11 @@ shorewall6_refresh () {
return 0 return 0
} }
# status of the firewall
shorewall6_status () {
$SRWL $SRWL_OPTS status && exit 0 || exit $?
}
case "$1" in case "$1" in
start) start)
shorewall6_start shorewall6_start
@ -123,8 +128,11 @@ case "$1" in
force-reload|restart) force-reload|restart)
shorewall6_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 exit 1
esac esac

View File

@ -115,6 +115,11 @@ shorewall6_refresh () {
return 0 return 0
} }
# status of the firewall
shorewall6_status () {
$SRWL $SRWL_OPTS status && exit 0 || exit $?
}
case "$1" in case "$1" in
start) start)
shorewall6_start shorewall6_start
@ -128,8 +133,11 @@ case "$1" in
force-reload|restart) force-reload|restart)
shorewall6_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 exit 1
esac esac