aboutsummaryrefslogtreecommitdiffstats
path: root/main/tvheadend/tvheadend.initd
blob: b72df337885a65d73b5f2ebca24057fe56bfb771 (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
#!/sbin/runscript

depend() {
        need net
}

start() {
        ebegin "Starting tvheadend"
	
	checkconf || return 1

        start-stop-daemon --start \
                --exec ${TVHBIN} -- \
                -C -f -u ${TVHUSER} \
                -c ${TVHCONF}
        eend $?
}

stop() {
        ebegin "Stopping tvheadend"
        start-stop-daemon --stop --quiet \
                --retry TERM/30/KILL/5 \
                --pidfile /var/run/tvheadend.pid
        eend $?
}

checkconf() {
	if [ ! -d "$TVHCONF" ]; then
		eerror "config directory does not exist!"
		return 1
	fi
}