aports/testing/crtmpserver/crtmpserver.initd

39 lines
844 B
Plaintext

#!/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 ${?}
}