Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | # source application-specific settings |
---|
4 | ROARD_ARGS='--daemon' |
---|
5 | [ -f /etc/conf.d/roard ] && . /etc/conf.d/roard |
---|
6 | |
---|
7 | . /etc/rc.conf |
---|
8 | . /etc/rc.d/functions |
---|
9 | |
---|
10 | PID=`pidof -o %PPID /usr/bin/roard` |
---|
11 | case "$1" in |
---|
12 | start) |
---|
13 | stat_busy "Starting Roaraudio Daemon" |
---|
14 | [ -z "$PID" ] && /usr/bin/roard ${ROARD_ARGS} |
---|
15 | if [ $? -gt 0 ]; then |
---|
16 | stat_fail |
---|
17 | else |
---|
18 | add_daemon roard |
---|
19 | stat_done |
---|
20 | fi |
---|
21 | ;; |
---|
22 | stop) |
---|
23 | stat_busy "Stopping Roaraudio Daemon" |
---|
24 | [ ! -z "$PID" ] && kill $PID &> /dev/null |
---|
25 | if [ $? -gt 0 ]; then |
---|
26 | stat_fail |
---|
27 | else |
---|
28 | rm_daemon roard |
---|
29 | stat_done |
---|
30 | fi |
---|
31 | ;; |
---|
32 | restart) |
---|
33 | $0 stop |
---|
34 | sleep 1 |
---|
35 | $0 start |
---|
36 | ;; |
---|
37 | *) |
---|
38 | echo "usage: $0 {start|stop|restart}" |
---|
39 | esac |
---|
40 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.