File: zebra.sh.in

package info (click to toggle)
frr 10.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 76,324 kB
  • sloc: ansic: 686,900; python: 225,905; perl: 6,379; sh: 2,627; cpp: 1,883; makefile: 670; yacc: 397; lex: 363; lisp: 66; xml: 35; javascript: 8
file content (55 lines) | stat: -rw-r--r-- 915 bytes parent folder | download | duplicates (3)
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
45
46
47
48
49
50
51
52
53
54
55
#!/bin/sh
#
# zebra is the head of the quagga routing beast
#
# PROVIDE: zebra
# REQUIRE: NETWORKING
##

PATH=/sbin:/bin:/usr/sbin:/usr/bin:@prefix@/sbin:@prefix@/bin
export PATH

if [ -f /etc/rc.subr ]
then
	. /etc/rc.subr
fi

name="zebra"
rcvar=$name
required_files="@e_sysconfdir@/${name}.conf"
command="@prefix@/sbin/${name}"
command_args="-d"

start_precmd="zebra_precmd"
stop_postcmd="zebra_postcmd"
socket_dir=@localstatedir@
pidfile="${socket_dir}/${name}.pid"

zebra_precmd()
{
    mkdir -p "${socket_dir}"
    chown quagga.quagga "${socket_dir}"
    chmod 750 "${socket_dir}"
    rc_flags="$(
	set -- $rc_flags
	while [ $# -ne 0 ]; do
	    if [ X"$1" = X-P -o X"$1" = X-A ]; then
		break
	    fi
	    shift
	done
	if [ $# -eq 0 ]; then
	    echo "-P 0"
	fi
	) $rc_flags"
}

zebra_postcmd()
{
    if [ -d "${socketdir}" ]; then
        rmdir ${socketdir}
    fi
}

load_rc_config $name
run_rc_command "$1"