2015-02-24 00:39:22 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# minidlnad Starts minidlnad.
|
|
|
|
#
|
|
|
|
|
|
|
|
start() {
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Starting minidlna: "
|
2015-02-24 00:39:22 +01:00
|
|
|
umask 077
|
|
|
|
start-stop-daemon -S -q -p /var/run/minidlna/minidlna.pid \
|
2015-08-21 19:55:18 +02:00
|
|
|
--exec /usr/sbin/minidlnad -- "$@"
|
2015-02-24 00:39:22 +01:00
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
|
|
}
|
|
|
|
stop() {
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Stopping minidlna: "
|
2015-02-24 00:39:22 +01:00
|
|
|
start-stop-daemon -K -q -p /var/run/minidlna/minidlna.pid
|
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
|
|
}
|
|
|
|
restart() {
|
|
|
|
stop
|
|
|
|
# Sleep needed for minidlna to restart properly
|
|
|
|
sleep 1
|
2015-08-21 19:55:18 +02:00
|
|
|
start "$@"
|
2015-02-24 00:39:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
restart|reload)
|
|
|
|
restart
|
|
|
|
;;
|
2015-08-21 19:55:18 +02:00
|
|
|
force-reload)
|
|
|
|
restart -R
|
|
|
|
;;
|
2015-02-24 00:39:22 +01:00
|
|
|
*)
|
2015-08-21 19:55:18 +02:00
|
|
|
echo "Usage: $0 {start|stop|restart|force-reload}"
|
2015-02-24 00:39:22 +01:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|