summaryrefslogtreecommitdiff
blob: fb374f43d35b93dc964acebceea56c32aeadc8dd (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
#!/sbin/openrc-run

description="sundtek TV mediaclient"
#command=/opt/bin/mediasrv
#command_args="-d --pluginpath /opt/bin"

set_preload() {
	yesno ${preload:-NO} || return 0
	LD_PRELOAD=${preload_lib:-/usr/lib}/libmediaclient.so${LD_PRELOAD:+ }${LD_PRELOAD-}
	export LD_PRELOAD
}

start() {
	ebegin "Starting ${SVCNAME}"
	(
		set_preload
		/opt/bin/mediaclient --start=4
	)
	eend $?
}

stop() {
	ebegin "Stopping ${SVCNAME}"
	(
		set_preload
		timeout -k "${killtime:-15}" "${termtime:-15}" /opt/bin/mediaclient --shutdown
	)
	eend $?
}