aboutsummaryrefslogtreecommitdiffstats
path: root/main/sems/sems.initd
blob: 0e96f8a21a30ecb2efcfecfd4b0516195ade5696 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/sbin/runscript
# SIP Express Media Server configuration file
# Follows Gentoo/AlpineLinux standards 
# GPL 2 License - N. Angelacos 2011

CONFDIR="/etc/sems"
SVC="${SVCNAME#*.}"
if [ -n "${SVC}" ] && [ "${SVCNAME}" != "sems" ]; then
        SEMSPID="/var/run/sems/${SVC}.pid"
	else
        SEMSPID="/var/run/sems/sems.pid"
	fi
SEMSCONF="${CONFDIR}/${SVC}.conf"
daemon=/usr/sbin/sems

depend() {
	need net
	after firewall
}

start() {
	ebegin "Starting  ${SVCNAME}"
	echo $SEMSPID   $SEMSCONF
	start-stop-daemon --start --quiet --pidfile $SEMSPID --exec $daemon \
		-- \
		-u sems \
		-g sems \
		-P $SEMSPID \
		-f $SEMSCONF
	eend $?
}

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