summaryrefslogtreecommitdiff
blob: d523c342000b898753c37ccca6fc5a595b02cee8 (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
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

CITSERVER=${SVCNAME#*.}
if [ -n "${CITSERVER}" ] && [ ${SVCNAME} != "webcit" ]; then
        WCPID="/var/run/webcit.${CITSERVER}.pid"
else    
        WCPID="/var/run/webcit.pid"
fi

depend() {
	need net
}

start() {
	ebegin "Starting ${SVCNAME}"
        start-stop-daemon --start --background \
		--exec /usr/sbin/webcit --make-pidfile \
		--pidfile "${WCPID}"  -- $WEBCIT_OPTS
	eend $? "Failed to start WebCit"
}

stop() {
	ebegin "Stopping ${SVCNAME}"
	start-stop-daemon --stop \
		--exec /usr/sbin/webcit --pidfile "${WCPID}"
	eend $? "Failed to stop ${SVCNAME}"
}

restart() {
	ebegin "Restarting ${SVCNAME}"
	svc_stop && sleep 3 && svc_start
	eend $? "Failed to restart WebCit"
}