updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / icecast-svn / rc-icecast
blob997e80cc7956291e1546180910b8ba0955c039d9
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/bin/icecast`
7 case "$1" in
8 start)
9 stat_busy "Starting Icecast Server"
10 [ -z "$PID" ] && /usr/bin/icecast -b -c /etc/icecast/icecast.xml &> /dev/null
11 if [ $? -gt 0 ]; then
12 stat_fail
13 else
14 add_daemon icecast
15 stat_done
18 stop)
19 stat_busy "Stopping Icecast Server"
20 [ ! -z "$PID" ] && kill $PID &> /dev/null
21 if [ $? -gt 0 ]; then
22 stat_fail
23 else
24 rm_daemon icecast
25 stat_done
28 reload)
29 stat_busy "Reloading Icecast Server configuration"
30 [ ! -z "$PID" ] && kill -HUP $PID &> /dev/null
31 if [ -z "$PID" ]; then
32 stat_fail
33 else
34 stat_done
37 restart)
38 $0 stop
39 sleep 2
40 $0 start
43 echo "usage: $0 {start|stop|reload|restart}"
44 esac
45 exit 0