summaryrefslogtreecommitdiffstats
path: root/pkgsrc/mgmtd.sh.in
blob: fb57c0a2fbdaab65f528f2701f513f0c6b2ee1dd (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
#!/bin/sh
#
# mgmtd is part of the quagga routing beast
#
# PROVIDE: mgmtd
# REQUIRE: none
##

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

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

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

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

zebra_precmd()
{
    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"
}

load_rc_config $name
run_rc_command "$1"