#!/sbin/openrc-run

command="/usr/bin/${RC_SVCNAME}"
command_args="--foreground --config-file /etc/rtpengine/${RC_SVCNAME}.conf"
command_background="yes"
: ${command_user:="rtpengine:rtpengine"}
pidfile="/run/rtpengine/${RC_SVCNAME}.pid"

depend() {
	need net
	after firewall
	before kamailio
}

start_pre() {
	checkpath --directory --owner "$command_user" "${pidfile%/*}"
}
