diff options
Diffstat (limited to 'config/quagga_ospfd/quaggactl')
-rw-r--r-- | config/quagga_ospfd/quaggactl | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/config/quagga_ospfd/quaggactl b/config/quagga_ospfd/quaggactl index 198a8411..6db7232e 100644 --- a/config/quagga_ospfd/quaggactl +++ b/config/quagga_ospfd/quaggactl @@ -1,11 +1,12 @@ #!/bin/sh RC_SCRIPT=/usr/local/etc/rc.d/quagga.sh +QUAGGA_CONFIG_BASE=/var/etc/quagga -ZEBRA_CONFIG=/usr/local/etc/quagga/zebra.conf +ZEBRA_CONFIG=${QUAGGA_CONFIG_BASE}/zebra.conf ZEBRA_PORT=2601 ZEBRA_PASSWORD=`/usr/bin/grep '^password ' ${ZEBRA_CONFIG} | /usr/bin/awk '{print $2};'` -OSPF_CONFIG=/usr/local/etc/quagga/ospfd.conf +OSPF_CONFIG=${QUAGGA_CONFIG_BASE}/ospfd.conf OSPF_PORT=2604 OSPF_PASSWORD=`/usr/bin/grep '^password ' ${OSPF_CONFIG} | /usr/bin/awk '{print $2};'` @@ -27,6 +28,10 @@ restart) $RC_SCRIPT restart ;; zebra) + if [ "`pgrep zebra`" = "" ]; then + echo "zebra does not appear to be running" + exit 1 + fi case $2 in cpu*) daemon_command ${ZEBRA_PORT} ${ZEBRA_PASSWORD} "show thread cpu" @@ -42,7 +47,11 @@ zebra) daemon_command ${ZEBRA_PORT} ${ZEBRA_PASSWORD} "show ip route" ;; esac ;; -ospf) +ospf*) + if [ "`pgrep ospfd`" = "" ]; then + echo "ospfd does not appear to be running" + exit 1 + fi case $2 in cpu*) daemon_command ${OSPF_PORT} ${OSPF_PASSWORD} "show thread cpu" |