Files
cantata/dynamic/init/cantata-dynamic.arch
2012-09-07 19:49:58 +00:00

28 lines
842 B
Bash
Executable File

#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
[[ -d /run/cantata-dynamic ]] || install -d -g mpd -o mpd /run/cantata-dynamic
case "$1" in
start)
stat_busy 'Starting Cantata MPD Dynamizer'
/usr/bin/cantata-dynamic server /etc/cantata-dynamic.conf &> /dev/null &&
{ add_daemon cantata-dynamic; stat_done; } || stat_fail
;;
stop)
stat_busy 'Stopping Cantata MPD Dynamizer'
/usr/bin/cantata-dynamic stopserver /etc/cantata-dynamic.conf &> /dev/null &&
{ rm_daemon cantata-dynamic; stat_done; } || stat_fail
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0