summaryrefslogtreecommitdiffstats
path: root/testing/yadifa/yadifa.initd
blob: ae0d67fc4f5921eb0b267d7766fde6156f1dc432 (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
38
#!/sbin/runscript
# Copyright 2014 Francesco Colista (francesco.colista@gmail.com)
# Distributed under the terms of the GNU General Public License, v2 or later#

depend() {
	need net
	after firewall
	provide dns
}

checkconfig() {
        if [ ! -f "${CONFFILE}" ]; then
                eerror "${CONFFILE} does not exist!"
                return 1
        fi
}

start() {
	ebegin "Starting ${SVCNAME}"
	start-stop-daemon --start --exec ${SVCBIN} \
		--pidfile ${PIDFILE} \
		-- -c ${CONFFILE} ${YADIFA_OPTS}
	eend $?
}

stop() {
        ebegin "Stopping ${SVCNAME}"
        start-stop-daemon --stop --exec ${SVCBIN} \
                --pidfile ${PIDFILE}
        eend $?
}

reload() {
        ebegin "Reloading ${SVCNAME}"
	start-stop-daemon --stop --oknodo --signal HUP \
		--exec ${SVCBIN} --pidfile ${PIDFILE}
	eend $?
}