updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / quagga / ospf6d
blob4d7781086df927fa3e7706a6cf1543285ffb8a54
1 #!/bin/bash
3 # GNU Zebra Routing Manager/RIP/RIPng/OSPF/OSPF6/BGPD4 start/stop script
5 # based on AUR/community/quagga 0.99.1-1 port template script
6 # by shild, shildv at gmail dot com
9 DNAME="ospf6d"
10 PORT="2606"
12 PID="`pidof -o %PPID /usr/sbin/$DNAME`"
14 . /etc/rc.conf
15 . /etc/rc.d/functions
17 . /etc/conf.d/quagga
19 case $1 in
20 start)
21 stat_busy "Starting Quagga $DNAME daemon"
23 if [ -z "$PID" -a -f /etc/quagga.d/$DNAME.conf ]
24 then
25 /usr/sbin/$DNAME -d \
26 -f /etc/quagga.d/$DNAME.conf \
27 -i /var/run/quagga/$DNAME.pid \
28 -A 127.0.0.1 \
29 -P $PORT \
30 -u quagga \
31 -g quagga
33 if [ $cpulimit_ospf6d = 1 ]
34 then
35 /usr/bin/cpulimit -P /usr/sbin/$DNAME -l $ospf6d_cpu -z \
36 > /dev/null 2> /dev/null &
39 sleep 1; # Wait for forking (PID changes)
41 PID="`pidof -o %PPID /usr/sbin/$DNAME`"
42 if [ -z "$PID" ]
43 then
44 stat_fail
45 else
46 add_daemon $DNAME
47 stat_done
50 else
51 stat_fail
54 sleep 1
56 stop)
57 stat_busy "Stopping Quagga $DNAME daemon"
59 [ ! -z "$PID" ] && kill "$PID" &> /dev/null
61 if [ $? -gt 0 ]
62 then
63 stat_fail
64 else
65 rm_daemon $DNAME
66 stat_done
69 restart)
70 $0 stop
71 sleep 1
72 $0 start
75 echo "usage: $0 [start|stop|restart]"
76 esac
78 exit 0
80 # EOF