From: Nathan Wagner Date: Fri, 6 Dec 2013 05:25:20 +0000 (+0000) Subject: improved rc.d example script X-Git-Url: https://pd.if.org/git/?p=startuptools;a=commitdiff_plain;h=02792f665ba30af4fa356a076cf438f338028a6e improved rc.d example script --- diff --git a/scripts/example.rc b/scripts/example.rc index b72880c..5853e97 100755 --- a/scripts/example.rc +++ b/scripts/example.rc @@ -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 $?