2015-02-23 16:39:22 -07:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# minidlnad Starts minidlnad.
|
|
|
|
#
|
|
|
|
|
|
|
|
start() {
|
2015-10-03 15:29:57 -06:00
|
|
|
printf "Starting minidlna: "
|
2015-02-23 16:39:22 -07:00
|
|
|
umask 077
|
|
|
|
start-stop-daemon -S -q -p /var/run/minidlna/minidlna.pid \
|
2015-08-21 11:55:18 -06:00
|
|
|
--exec /usr/sbin/minidlnad -- "$@"
|
2015-02-23 16:39:22 -07:00
|
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
|
|
}
|
|
|
|
stop() {
|
2015-10-03 15:29:57 -06:00
|
|
|
printf "Stopping minidlna: "
|
2015-02-23 16:39:22 -07: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 11:55:18 -06:00
|
|
|
start "$@"
|
2015-02-23 16:39:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
restart|reload)
|
|
|
|
restart
|
|
|
|
;;
|
2015-08-21 11:55:18 -06:00
|
|
|
force-reload)
|
|
|
|
restart -R
|
|
|
|
;;
|
2015-02-23 16:39:22 -07:00
|
|
|
*)
|
2015-08-21 11:55:18 -06:00
|
|
|
echo "Usage: $0 {start|stop|restart|force-reload}"
|
2015-02-23 16:39:22 -07:00
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit $?
|