From 02792f665ba30af4fa356a076cf438f338028a6e Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Fri, 6 Dec 2013 05:25:20 +0000 Subject: [PATCH] improved rc.d example script --- scripts/example.rc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 $? -- 2.40.0