blob: c4a1fe79593a0122d354856e7d37a0f73ee04c31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/sh
#PKG minidlna
#INIT 60
. /etc/rc.conf
pidfile=$(echo "$minidlna_flags" | sed -n 's/.*-P \([^ ]\+\).*/\1/p')
[ "$pidfile" ] || pidfile="/var/run/minidlna/minidlna.pid"
case $1 in
autostop) ;;
autostart)
test x"${minidlna:-NO}" = x"NO" && exit 0
test x"$minidlna" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
exec sh $0 start
;;
start)
/usr/sbin/minidlnad $minidlna_flags
;;
stop)
if [ -f "$pidfile" ]; then
kill $(<$pidfile)
rm $pidfile
else
kill $(pgrep -f /usr/sbin/minidlnad)
fi
;;
restart)
sh $0 stop
sleep 1
sh $0 start
;;
*)
echo "usage: $0 (start | stop | restart)"
exit 1
esac
exit $?
|