blob: 30dc2832ff1a9c89d1d093a2eda3ab3a880cd20c (
plain) (
blame)
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
|
#! /bin/sh
#
# $FreeBSD: /tmp/pcvs/ports/net/zebra-devel/files/Attic/zebractl.sh,v 1.4 2001-01-27 08:58:15 andreas Exp $
#
# zebra start/stop script by "Andreas Klemm <andreas@FreeBSD.ORG>"
#
usage()
{
echo "$0: usage: $0 [ start | stop | restart ]"
exit 1
}
if [ $# -lt 1 ]; then
echo "$0: error: one argument needed"; usage
elif [ $# -gt 1 ]; then
echo "$0: error: only one argument needed"; usage
fi
case $1 in
start)
[ -f !!PREFIX!!/etc/zebra/zebra.conf ] && ( \
!!PREFIX!!/sbin/zebra -d > /dev/null 2>&1 \
echo -n ' zebra' )
[ -f !!PREFIX!!/etc/zebra/ripd.conf ] && ( \
!!PREFIX!!/sbin/ripd -d > /dev/null 2>&1 \
echo -n ' ripd' )
[ -f !!PREFIX!!/etc/zebra/ospfd.conf ] && ( \
!!PREFIX!!/sbin/ospfd -d > /dev/null 2>&1 \
echo -n ' ospfd' )
[ -f !!PREFIX!!/etc/zebra/bgpd.conf ] && ( \
!!PREFIX!!/sbin/bgpd -d > /dev/null 2>&1 \
echo -n ' bgpd' )
;;
stop)
[ -f !!PREFIX!!/etc/zebra/ripd.conf ] && killall ripd
[ -f !!PREFIX!!/etc/zebra/ospfd.conf ] && killall ospfd
[ -f !!PREFIX!!/etc/zebra/bgpd.conf ] && killall bgpd
[ -f !!PREFIX!!/etc/zebra/zebra.conf ] && killall zebra
;;
restart)
$0 stop
$0 start
;;
*) echo "$0: error: unknown option $1"
usage
;;
esac
exit 0
|