diff options
author | Phil Sutter <phil@nwl.cc> | 2025-01-06 01:27:12 +0100 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2025-01-06 11:53:44 +0100 |
commit | be735c88debdd1e3207af9c403e3c594798a3944 (patch) | |
tree | 0c99b2831a3e8b3add3070f8076177f2845b1279 /package/minidlna/files/minidlna.init | |
parent | fad1d3192c26fae8423907c9de6af2fe2b03dea6 (diff) |
package: Port minidlna
This is a more capable alternative to gmediaserver.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'package/minidlna/files/minidlna.init')
-rw-r--r-- | package/minidlna/files/minidlna.init | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/package/minidlna/files/minidlna.init b/package/minidlna/files/minidlna.init new file mode 100644 index 000000000..c4a1fe795 --- /dev/null +++ b/package/minidlna/files/minidlna.init @@ -0,0 +1,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 $? |