]> TLD Linux GIT Repositories - packages/shorewall.git/commitdiff
- fix init script
authorMarcin Krol <hawk@tld-linux.org>
Wed, 20 Jun 2018 13:45:25 +0000 (13:45 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Wed, 20 Jun 2018 13:45:25 +0000 (13:45 +0000)
shorewall.init

index e725f39c79b7cb107ddd437a59cbf90a5d767828..eec2f2894ee07d5068ba28f483bd4d190e6a5750 100755 (executable)
@@ -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)