#!/sbin/openrc-run

command=/usr/sbin/spreed-webrtc-server
pidfile=/var/run/spreed-webrtc/${SVCNAME}.pid
conf=/etc/spreed-webrtc/${SVCNAME}.conf
logfile=/var/log/spreed-webrtc/spreed-webrtc-server.log
command_args="-c $conf -l $logfile"

: ${exec_user:=spreed}
: ${exec_group:=spreed}

start_stop_daemon_args="--user $exec_user --group $exec_group --background --make-pidfile"

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath --directory ${pidfile%/*} --directory ${logfile%/*} \
		--owner ${exec_user}:${exec_group}
}
