]> pd.if.org Git - startuptools/commitdiff
improved rc.d example script
authorNathan Wagner <nw@hydaspes.if.org>
Fri, 6 Dec 2013 05:25:20 +0000 (05:25 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Fri, 6 Dec 2013 05:25:20 +0000 (05:25 +0000)
scripts/example.rc

index b72880c6da0d843680fc7d256b163d6493569c05..5853e975bfd3613e4a86cfa0f7ea17be188ae273 100755 (executable)
@@ -1,16 +1,23 @@
 #!/bin/sh
 
+. /etc/rc.d/functions.rc
 . /etc/rc.conf
 
 case "$1" in 
        start)
-               exit 0
+               status_starting $0
+               /bin/true
+               status_check
                ;;
        stop)
-               exit 0;
+               status_stopping $0
+               /bin/true
+               status_check
                ;;
        restart)
-               exit 0;
+               status_begin restarting $0
+               $0 stop && sleep 1 && $0 start
+               status_check
                ;;
        status)
                exit 0;
@@ -19,3 +26,5 @@ case "$1" in
                echo "usage: $0 {start | stop | restart | status }"
                exit 1
 esac
+
+exit $?