aboutsummaryrefslogtreecommitdiffstats
path: root/testing/crtmpserver/crtmpserver.initd
blob: 656eb4029d500e6e3946af1b6465cff7c7a3c07f (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
33
34
35
36
37
38
#!/sbin/runscript
# Copyright (c) 2011 http://foxpa.ws
# All rights released

description="Runs C++ RTMP Server on Gentoo"

depend()
{
        need net
}

checkconfig() {
        if [ ! -e /etc/crtmpserver/crtmpserver.lua ] ; then
	        eerror "You need to create /etc/crtmpserver/crtmpserver.lua first."
	        eerror "An example can be found in /etc/crtmpserver/crtmpserver.lua.sample"
        return 1
	fi
}      



start()
{
	checkconfig || return 1
        ebegin "Starting C++ RTMP Server"
        start-stop-daemon --start --quiet --exec /usr/sbin/crtmpserver \
			-- --daemon --uid=${RTMPD_USER} --pid=/var/run/crtmpserver.pid ${CONFFILE}
        eend ${?}
}

stop()
{
        ebegin "Stopping C++ RTMP Server"
	start-stop-daemon --stop --quiet \
		--exec /usr/sbin/crtmpserver --pid=/var/run/crtmpserver.pid
        eend ${?}
}