aboutsummaryrefslogtreecommitdiffstats
path: root/community/mumudvb/mumudvb.initd
blob: 95f88a10dceae97f8eb94fd727666b6c65ab80d8 (plain) (blame)
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
33
34
35
36
37
#!/sbin/openrc-run

name="MuMuDVB"
command="/usr/bin/mumudvb"
command_background="true"
pidfile="/var/run/mumudvb/mumudvb.pid"
daemonuser="mumudvb"

checkconfig() {
	if [ ! -f "$CONFIG_FILE" ] ; then
		eerror "You need to setup $CONFIG_FILE first. Install $pkgname-doc for examples"
		return 1
	fi
}


depend() {
        need net
        after firewall
}

start () {
		checkconfig || return 1
        ebegin "Starting $name"
		start-stop-daemon --start --name mumudvb_$ADAPTER \
    		--make-pidfile --pidfile $pidfile \
        	--user $daemonuser --exec $command -- $COMMAND_ARGS --card $ADAPTER -c $CONFIG_FILE
        eend $?
}

stop () {
        ebegin "Stopping $name"
        start-stop-daemon --stop --pidfile $pidfile \
        	--exec $command
        eend $?
}