diff options
Diffstat (limited to 'unmaintained/crtmpserver/crtmpserver.initd')
-rw-r--r-- | unmaintained/crtmpserver/crtmpserver.initd | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/unmaintained/crtmpserver/crtmpserver.initd b/unmaintained/crtmpserver/crtmpserver.initd new file mode 100644 index 0000000000..656eb4029d --- /dev/null +++ b/unmaintained/crtmpserver/crtmpserver.initd @@ -0,0 +1,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 ${?} +} + |