]>
Commit | Line | Data |
---|---|---|
a127ab8e | 1 | #!/bin/sh |
2 | # | |
3 | # ices This shell script takes care of starting and stopping | |
4 | # ices. | |
5 | # | |
c9ddb353 | 6 | # chkconfig: 345 96 24 |
7399ca06 | 7 | # description: Icecast is an Internet audio broadcasting system based on \ |
c9ddb353 | 8 | # MPEG audio technology. Ices is a streamer for icecast. |
a127ab8e | 9 | |
10 | # Source function library. | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # Source networking configuration. | |
14 | . /etc/sysconfig/network | |
15 | ||
16 | # Check that networking is up. | |
c9ddb353 | 17 | if is_yes "${NETWORKING}"; then |
9467d4f7 | 18 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then |
c9ddb353 | 19 | msg_network_down ices |
20 | exit 1 | |
21 | fi | |
22 | else | |
23 | exit 0 | |
24 | fi | |
a127ab8e | 25 | |
26 | # Check that ices.conf exists. | |
925004e9 | 27 | [ -f /etc/icecast/ices.xml ] || (echo \ |
28 | 'There are three config files: | |
29 | /etc/icecast/ices-oss.xml - conf for oss; | |
30 | /etc/icecast/ices-alsa.xml - conf for alsa; | |
31 | /etc/icecast/ices-playlist.xml - conf for playlist; | |
fa2d27c0 | 32 | After choosing one of them you have to configure it before run and rename |
925004e9 | 33 | to /etc/icecast/ices.xml. Enjoy! Your PLD Team'\ |
fa2d27c0 | 34 | && exit 0) |
a127ab8e | 35 | |
310fe12c | 36 | |
a127ab8e | 37 | # See how we were called. |
38 | case "$1" in | |
39 | start) | |
310fe12c | 40 | # Check if the service is already running? |
41 | if [ ! -f /var/lock/subsys/ices ]; then | |
42 | # Start daemons. | |
43 | msg_starting ices | |
44 | # daemon --user icecast -s /bin/sh 'ices' | |
45 | # Our daemon function doesn't include su's --shell function | |
925004e9 | 46 | su icecast -s /bin/sh -c 'ices /etc/ices/ices.xml' |
310fe12c | 47 | touch /var/lock/subsys/ices |
48 | else | |
49 | msg_already_running ices | |
fa2d27c0 | 50 | fi |
a127ab8e | 51 | ;; |
52 | stop) | |
51fb23b3 | 53 | if [ -f /var/lock/subsys/ices ]; then |
310fe12c | 54 | # Stop daemons. |
55 | msg_stopping ices | |
56 | killproc ices 2> /dev/null | |
57 | rm -f /var/lock/subsys/ices | |
58 | else | |
59 | msg_not_running ices | |
60 | fi | |
a127ab8e | 61 | ;; |
310fe12c | 62 | restart|force-reload) |
c9ddb353 | 63 | $0 stop |
64 | $0 start | |
310fe12c | 65 | exit $? |
c9ddb353 | 66 | ;; |
a127ab8e | 67 | status) |
68 | status ices | |
310fe12c | 69 | exit $? |
a127ab8e | 70 | ;; |
71 | *) | |
310fe12c | 72 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
73 | exit 3 | |
a127ab8e | 74 | esac |
75 | ||
76 | exit 0 |