stunnel: adjust initscript
authorGustavo Zacarias <gustavo@zacarias.com.ar>
Mon, 15 Dec 2014 22:56:27 +0000 (19:56 -0300)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 15 Dec 2014 23:45:44 +0000 (00:45 +0100)
Use proper status messages, make spacing standard instead of a mix of
spacing/tabbing, drop boringly obvious comment from the header.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/stunnel/S50stunnel

index 95bb3018710b7c6f2fa7dfc670759eae38ec56b0..5827fe0f8c84128f364ca336c039ac480e9fc281 100644 (file)
@@ -1,36 +1,35 @@
 #!/bin/sh
-#
-# Starts stunnel
-#
 
 start() {
-       echo -n "Starting stunnel: "
-       start-stop-daemon -S -q -p /var/run/stunnel.pid --exec /usr/bin/stunnel
-       echo "OK"
+  echo -n "Starting stunnel: "
+  start-stop-daemon -S -q -p /var/run/stunnel.pid --exec /usr/bin/stunnel
+  [ $? = 0 ] && echo "OK" || echo "FAIL"
 }
+
 stop() {
-       echo -n "Stopping stunnel: "
-       start-stop-daemon -K -q -p /var/run/stunnel.pid
-       echo "OK"
+  echo -n "Stopping stunnel: "
+  start-stop-daemon -K -q -p /var/run/stunnel.pid
+  [ $? = 0 ] && echo "OK" || echo "FAIL"
 }
+
 restart() {
-       stop
-       start
+  stop
+  start
 }
 
 case "$1" in
   start)
-       start
-       ;;
+    start
+    ;;
   stop)
-       stop
-       ;;
+    stop
+    ;;
   restart|reload)
-       restart
-       ;;
+    restart
+    ;;
   *)
-       echo "Usage: $0 {start|stop|restart}"
-       exit 1
+    echo "Usage: $0 {start|stop|restart}"
+    exit 1
 esac
 
 exit $?