aboutsummaryrefslogtreecommitdiffstats
path: root/main/minidlna/minidlna.initd
blob: 4d5a2fe902320c7e6a837a6919d0af8dad291056 (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
#!/sbin/openrc-run

name="MiniDLNA"
configfile="${CONFIG:-/etc/minidlna.conf}"
start_stop_daemon_args="--user ${M_USER:-minidlna} --group ${M_GROUP:-minidlna}"
pidfile="/var/run/minidlna/minidlna.pid"
command=/usr/sbin/minidlnad
command_args="-f ${configfile} -P $pidfile"

depend() {
	need net
}

start_pre() {
	if ! [ -f "${configfile}" ]; then
		eerror "${configfile} is missing"
		return 1
	fi
	if yesno "${RESCAN}"; then
		command_args="$command_args -R"
	fi
	
	checkpath --owner  ${M_USER:-minidlna}:${M_GROUP:-minidlna} \
		--directory ${pidfile%/*}
}