]> git.pld-linux.org Git - packages/darkice.git/commitdiff
- guess what this file does
authorMariusz Mazur <mmazur@pld-linux.org>
Sat, 6 Jan 2007 00:20:55 +0000 (00:20 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    darkice.init -> 1.1

darkice.init [new file with mode: 0644]

diff --git a/darkice.init b/darkice.init
new file mode 100644 (file)
index 0000000..823b055
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+# darkice      This shell script takes care of starting and stopping darkice
+#
+# chkconfig:   345 97 23
+# description: Darkice is a stream provider for IceCast/ShoutCast servers
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down darkice
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/darkice ]; then
+               msg_starting darkice
+               busy
+               daemon /usr/sbin/daemon -u darkice -o /var/log/darkice.log -P /var/run/darkice -n darkice -- /usr/bin/darkice -c /etc/darkice.cfg >/dev/null
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && ok || fail
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/darkice
+       else
+               msg_already_running Darkice
+       fi
+       ;;
+  stop)
+       # Stop daemons.
+       if [ -f /var/lock/subsys/darkice ]; then
+               msg_stopping darkice
+               busy
+               /usr/sbin/daemon -P /var/run/darkice -n darkice --stop >/dev/null && ok || fail
+               rm -f /var/lock/subsys/darkice >/dev/null 2>&1
+       else
+               msg_not_running Darkice
+       fi
+       ;;
+  restart)
+       $0 stop
+       $0 start
+       ;;
+  status)
+       status darkice
+       /usr/sbin/daemon -P /var/run/darkice --verbose --running -n darkice
+       exit $?
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|status}"
+       exit 3
+esac
+
+exit $RETVAL
This page took 0.069661 seconds and 4 git commands to generate.