]> pd.if.org Git - startuptools/blob - scripts/example.rc
improved rc.d example script
[startuptools] / scripts / example.rc
1 #!/bin/sh
2
3 . /etc/rc.d/functions.rc
4 . /etc/rc.conf
5
6 case "$1" in 
7         start)
8                 status_starting $0
9                 /bin/true
10                 status_check
11                 ;;
12         stop)
13                 status_stopping $0
14                 /bin/true
15                 status_check
16                 ;;
17         restart)
18                 status_begin restarting $0
19                 $0 stop && sleep 1 && $0 start
20                 status_check
21                 ;;
22         status)
23                 exit 0;
24                 ;;
25         *)
26                 echo "usage: $0 {start | stop | restart | status }"
27                 exit 1
28 esac
29
30 exit $?