summaryrefslogtreecommitdiff
blob: 102ac80c287c94db1a664c7d622ae939808bbb72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/sbin/openrc-run

depend() {
	need avahi-daemon
}

start() {
	ebegin "Starting Plex Media Server"
	start-stop-daemon -S -m -p ${PLEX_PIDFILE} -1 ${PLEX_OUTLOG} -2 ${PLEX_ERRLOG} --quiet -u ${PLEX_USER} -N -5 -b --exec ${PLEX_SCRIPT}
	eend $?
}

stop() {
	ebegin "Stopping Plex Media Server"
	kill -- -`cat ${PLEX_PIDFILE}`

	# Remove stale pid file since this is a dirty solution
	rm ${PLEX_PIDFILE}
	eend $?
}