]> git.pld-linux.org Git - packages/ices.git/blob - ices.init
- some ugly hacks - default config is in XML format; I made some trick to
[packages/ices.git] / ices.init
1 #!/bin/sh
2 #
3 # ices          This shell script takes care of starting and stopping
4 #               ices.
5 #
6 # chkconfig: 345 96 24
7 # description: Icecast is an Internet audio broadcasting system based on
8 #              MPEG audio technology. Ices is a streamer for icecast.
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.
17 [ ${NETWORKING} = "no" ] && exit 0
18
19 # Check that ices.conf exists.
20 [ -f /etc/icecast/ices.conf ] || (echo \
21 'There are two config files:
22 /etc/icecast/ices.conf.dist - default config (you must have XML support);
23 /etc/icecast/ices.conf.txt - text config file made for PLD by jack@pld.org.pl
24 After choosing one of them you have to configure it before run and rename 
25 to /etc/icecast/ices.conf. Enjoy!                             Your PLD Team'\
26 && exit 0)
27
28 # See how we were called.
29 case "$1" in
30   start)
31         # Start daemons.
32         msg_starting ices
33         # daemon --user icecast -s /bin/sh 'ices'
34         # Our daemon function doesn't include su's --shell function
35         [ -f /etc/icecast/ices.conf ] && \
36         ICES_CONFIG=`file /etc/icecast/ices.conf|grep XML`
37         if [ ${ICES_CONFIG} = "" ]; then
38         su icecast -s /bin/sh -c 'ices -c /etc/icecast/ices.conf'
39         else 
40         . /etc/icecast/ices.conf
41         su icecast -s /bin/sh -c "ices ${ICES_OPTIONS}"
42         fi
43         ok
44         touch /var/lock/subsys/ices
45         ;;
46   stop)
47         # Stop daemons.
48         msg_stopping ices
49         killproc ices 2> /dev/null
50         rm -f /var/lock/subsys/ices
51         ;;
52   restart)
53         $0 stop
54         $0 start
55         ;;
56   status)
57         status ices
58         ;;
59   *)
60         msg_usage "$0 {start|stop|restart|status}"
61         exit 1
62 esac
63
64 exit 0
This page took 0.030268 seconds and 4 git commands to generate.