]> git.pld-linux.org Git - packages/ices.git/blob - ices.init
- fixed multi-line descriptions
[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 if is_yes "${NETWORKING}"; then
18         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19                 msg_network_down ices
20                 exit 1
21         fi
22 else
23         exit 0
24 fi
25
26 # Check that ices.conf exists.
27 [ -f /etc/icecast/ices.conf ] || (echo \
28 'There are two config files:
29 /etc/icecast/ices.conf.dist - default config (you must have XML support);
30 /etc/icecast/ices.conf.txt - text config file made for PLD by jack@pld.org.pl
31 After choosing one of them you have to configure it before run and rename 
32 to /etc/icecast/ices.conf. Enjoy!                             Your PLD Team'\
33 && exit 0)
34
35
36 # See how we were called.
37 case "$1" in
38   start)
39         # Check if the service is already running?
40         if [ ! -f /var/lock/subsys/ices ]; then
41                 # Start daemons.
42                 msg_starting ices
43                 # daemon --user icecast -s /bin/sh 'ices'
44                 # Our daemon function doesn't include su's --shell function
45                 [ -f /etc/icecast/ices.conf ] && \
46                 ICES_CONFIG=`file /etc/icecast/ices.conf|grep XML`
47                 if [ ${ICES_CONFIG} = "" ]; then
48                         su icecast -s /bin/sh -c 'ices -c /etc/icecast/ices.conf'
49                 else 
50                         . /etc/icecast/ices.conf
51                         su icecast -s /bin/sh -c "ices ${ICES_OPTIONS}"
52                 fi
53                 ok
54                 touch /var/lock/subsys/ices
55         else
56                 msg_already_running ices
57         fi
58         ;;
59   stop)
60         if [ ! -f /var/lock/subsys/ices ]; then
61                 # Stop daemons.
62                 msg_stopping ices
63                 killproc ices 2> /dev/null
64                 rm -f /var/lock/subsys/ices
65         else
66                 msg_not_running ices
67         fi
68         ;;
69   restart|force-reload)
70         $0 stop
71         $0 start
72         exit $?
73         ;;
74   status)
75         status ices
76         exit $?
77         ;;
78   *)
79         msg_usage "$0 {start|stop|restart|force-reload|status}"
80         exit 3
81 esac
82
83 exit 0
This page took 0.090279 seconds and 4 git commands to generate.