From: Marcin Krol Date: Wed, 20 Jun 2018 13:45:25 +0000 (+0000) Subject: - fix init script X-Git-Url: https://git.tld-linux.org/?a=commitdiff_plain;h=acf8c63f219083eb0a4541c60af405379a555f96;p=packages%2Fshorewall.git - fix init script --- diff --git a/shorewall.init b/shorewall.init index e725f39..eec2f28 100755 --- a/shorewall.init +++ b/shorewall.init @@ -31,10 +31,15 @@ start() { fi msg_starting "Shorewall" - deltext; ok - # FIXME: use daemon and handle OK/FAIL - exec /sbin/shorewall -q start >/dev/null - touch /var/lock/subsys/shorewall + busy + /usr/sbin/shorewall -q start >/dev/null + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + ok + touch /var/lock/subsys/shorewall + else + fail + fi } stop() { @@ -44,21 +49,28 @@ stop() { fi msg_stopping "Shorewall" - deltext; ok - # FIXME: use killproc or handle OK/FAIL manually - exec /sbin/shorewall stop >/dev/null - rm -f /var/lock/subsys/shorewall >/dev/null 2>&1 + busy + /usr/sbin/shorewall stop >/dev/null + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + ok + rm -f /var/lock/subsys/shorewall >/dev/null 2>&1 + else + fail + fi } # See how we were called case "$1" in start) + start ;; stop) + stop ;; status) status shorewall - exec /sbin/shorewall status + exec /usr/sbin/shorewall status exit $? ;; restart)