tidak lupa :
sudo chmod +x /etc/init.d/darkice
sudo update-rc.d darkice defaults
#!/bin/sh
# Start/stop the darkice daemon
#
### BEGIN INIT INFO
# Provides: darkice
# Required-Start: $syslog $time
# Required-Stop: $syslog $time
# Default-Start: 2 3 4 5 6
# Default-Stop: S 0 1 6
# Short-Description: Darkice Audio streamer
# Description: Darkice Audio streamer
### END INIT INFO
test -f /usr/local/bin/darkice || exit 0
. /lib/lsb/init-functions
case "$1" in
start) log_begin_msg "Starting Darkice audio streamer..."
start-stop-daemon --start -b -m -p /var/run/darkice.pid -n darkice -x /usr/local/bin/darkice -- -c /usr/local/etc/darkice.cfg
log_end_msg $?
;;
stop) log_begin_msg "Stopping Darkice audio streamer..."
start-stop-daemon --stop --quiet --pidfile /var/run/darkice.pid --name darkice
log_end_msg $?
;;
restart) log_begin_msg "Restarting Darkice audio streamer..."
start-stop-daemon --stop --retry 5 --quiet --pidfile /var/run/darkice.pid --name darkice
start-stop-daemon --start -b -m -p /var/run/darkice.pid -n darkice -x /usr/local/bin/darkice -- -c /usr/local/etc/darkice.cfg
log_end_msg $?
;;
*) log_success_msg "Usage: /etc/init.d/darkice start|stop|restart"
exit 1
;;
esac
exit 0
No comments:
Post a Comment