blob: e4750f7421e77bb16927b65cd7169d0df7ecc7e2 [file] [log] [blame]
gdt69f1fc22004-08-27 15:57:35 +00001#!/bin/sh
2#
3# zebra is the head of the quagga routing beast
4#
5# PROVIDE: zebra
6# REQUIRE: NETWORKING
7##
8
9PATH=/sbin:/bin:/usr/sbin:/usr/bin:@PREFIX@/sbin:@PREFIX@/bin
10export PATH
11
12if [ -f /etc/rc.subr ]
13then
14 . /etc/rc.subr
15fi
16
17name="zebra"
18rcvar=$name
19required_files="@PKG_SYSCONFDIR@/${name}.conf"
20command="@PREFIX@/sbin/${name}"
21command_args="-d"
22
23start_precmd="zebra_precmd"
24stop_postcmd="zebra_postcmd"
25socket_dir=/var/run/zebra
26pidfile="${socket_dir}/${name}.pid"
27
28zebra_precmd()
29{
30 mkdir -p "${socket_dir}"
31 chown quagga.quagga "${socket_dir}"
32 chmod 750 "${socket_dir}"
33 rc_flags="$(
34 set -- $rc_flags
35 while [ $# -ne 0 ]; do
36 if [ X"$1" = X-P -o X"$1" = X-A ]; then
37 break
38 fi
39 shift
40 done
41 if [ $# -eq 0 ]; then
42 echo "-P 0"
43 fi
44 ) $rc_flags"
45}
46
47zebra_postcmd()
48{
49 if [ -d "${socketdir}" ]; then
50 rmdir ${socketdir}
51 fi
52}
53
54load_rc_config $name
55run_rc_command "$1"