aboutsummaryrefslogblamecommitdiffstats
path: root/testing/kamailio/kamailio.initd
blob: a99992edf93b0928239b11f3a963691e969667fd (plain) (tree)

































                                                                             
#!/sbin/runscript

daemon=/usr/sbin/kamailio
pidfile=/var/run/kamailio/kamailio.pid

extra_started_commands="reload"

depend() {
	need net
	after firewall
}

start() {
	ebegin "Starting Kamailio"
	start-stop-daemon --start --quiet --pidfile $pidfile --exec $daemon \
		-- \
		-u ${KAMAILIO_USER:-kamailio} \
		-g ${KAMAILIO_GROUP:-kamailio} \
		-P $pidfile \
		${KAMAILIO_OPTS:-}
	eend $?
}

stop() {
	ebegin "Stopping Kamailio"
	start-stop-daemon --stop --quiet --pidfile $pidfile
	eend $?
}

reload() {
	ebegin "Reloading Kamailio"
	echo mi_dg dp_reload | sercmd 2>/dev/null
	eend $?
}