blob: 307f1a937cd9052f55c2092281b8549b715cc844 (
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
39
40
41
42
43
44
|
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/files/quagga-services.init.3,v 1.1 2011/10/21 22:51:52 flameeyes Exp $
: ${CFGFILE:=/etc/quagga/${SVCNAME}.conf}
pidfile=/var/run/quagga/${SVCNAME}.pid
command=/usr/sbin/${SVCNAME}
command_args="-d -f ${CFGFILE} ${EXTRA_OPTS} --pid_file ${pidfile}"
get_service_config() {
[ -e "$CFGFILE" ] || return
awk '$1 == "'$1'" { s=$2 } END { print s }' "$CFGFILE"
}
depend() {
config "$CFGFILE"
[ ${SVCNAME} = "zebra" ] && need net || need zebra
[ "$(get_service_config log)" = "syslog" ] && \
use logger
}
start_pre() {
if [ ! -e "${CFGFILE}" ] ; then
eerror "Before starting ${SVCNAME} you have to configure it, by creating"
eerror "a ${CFGFILE} file."
eerror ""
eerror "A sample file has been installed in `ls /usr/share/doc/quagga-*/samples/${SVCNAME}.conf.sample`"
return 1
fi
checkpath -d -m 0750 -o quagga:quagga /var/run/quagga
if [ ${SVCNAME} = "zebra" ]; then
ebegin "Cleaning up stale zebra routes..."
ip route flush proto zebra
eend $?
fi
}
|