Last active
December 10, 2015 19:48
-
-
Save FeroVolar/4483611 to your computer and use it in GitHub Desktop.
IceCast StartStop script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# icecast This shell script takes care of starting and stopping | |
# the icecast multimedia streaming systen. | |
# | |
# config: /etc/icecast/icecast.xml | |
# Source function library. | |
. /etc/rc.d/init.d/functions | |
[ -x /usr/local/bin/icecast ] || exit 0 | |
# See how we were called. | |
case "$1" in | |
start) | |
# Start daemon. | |
echo -n $"Starting icecast streaming daemon: " | |
daemon "/usr/local/bin/icecast -c /etc/icecast/icecast.xml -b" | |
RETVAL=$? | |
echo | |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/icecast | |
/etc/icecast/ices-start | |
;; | |
stop) | |
# Stop daemon. | |
echo -n $"Shutting down icecast streaming daemon: " | |
/etc/icecast/ices-stop | |
killproc icecast | |
RETVAL=$? | |
echo | |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/icecast | |
;; | |
status) | |
status icecast | |
RETVAL=$? | |
;; | |
restart) | |
$0 stop | |
$0 start | |
;; | |
reload) | |
echo -n $"Reloading icecast: " | |
killproc icecast -HUP | |
RETVAL=$? | |
echo | |
;; | |
condrestart) | |
[ -f /var/lock/subsys/icecast ] && restart || : | |
;; | |
*) | |
echo $"Usage: $0 {start|stop|status|restart|reload}" | |
RETVAL=1 | |
;; | |
esac | |
exit $RETVAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment