|
@@ -7,26 +7,40 @@
|
|
|
zebra_enable="yes"
|
|
zebra_enable="yes"
|
|
|
zebra_protocols="rip ospf bgp"
|
|
zebra_protocols="rip ospf bgp"
|
|
|
|
|
|
|
|
|
|
+%common
|
|
|
|
|
+ zebra_start () {
|
|
|
|
|
+ ( cd @l_prefix@/etc/zebra
|
|
|
|
|
+ @l_prefix@/sbin/zebra -d
|
|
|
|
|
+ for protocol in $zebra_protocols; do
|
|
|
|
|
+ if [ -f @l_prefix@/sbin/${protocol}d ]; then
|
|
|
|
|
+ @l_prefix@/sbin/${protocol}d -d
|
|
|
|
|
+ fi
|
|
|
|
|
+ done
|
|
|
|
|
+ @l_prefix@/bin/vtysh -b
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ zebra_stop () {
|
|
|
|
|
+ if [ -f @l_prefix@/var/zebra/zebra.pid ]; then
|
|
|
|
|
+ kill -TERM `cat @l_prefix@/var/zebra/zebra.pid` >/dev/null 2>&1 || true
|
|
|
|
|
+ fi
|
|
|
|
|
+ for protocol in $zebra_protocols; do
|
|
|
|
|
+ if [ -f @l_prefix@/var/zebra/${protocol}d.pid ]; then
|
|
|
|
|
+ kill -TERM `cat @l_prefix@/var/zebra/${protocol}d.pid` >/dev/null 2>&1 || true
|
|
|
|
|
+ fi
|
|
|
|
|
+ done
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
%start -p 200 -u @l_susr@
|
|
%start -p 200 -u @l_susr@
|
|
|
opServiceEnabled zebra || exit 0
|
|
opServiceEnabled zebra || exit 0
|
|
|
- ( cd @l_prefix@/etc/zebra
|
|
|
|
|
- @l_prefix@/sbin/zebra -d
|
|
|
|
|
- for protocol in $zebra_protocols; do
|
|
|
|
|
- if [ -f @l_prefix@/sbin/${protocol}d ]; then
|
|
|
|
|
- @l_prefix@/sbin/${protocol}d -d
|
|
|
|
|
- fi
|
|
|
|
|
- done
|
|
|
|
|
- @l_prefix@/bin/vtysh -b
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ zebra_start
|
|
|
|
|
|
|
|
%stop -p 200 -u @l_susr@
|
|
%stop -p 200 -u @l_susr@
|
|
|
opServiceEnabled zebra || exit 0
|
|
opServiceEnabled zebra || exit 0
|
|
|
- if [ -f @l_prefix@/var/zebra/zebra.pid ]; then
|
|
|
|
|
- kill -TERM `cat @l_prefix@/var/zebra/zebra.pid` >/dev/null 2>&1 || true
|
|
|
|
|
- fi
|
|
|
|
|
- for protocol in $zebra_protocols; do
|
|
|
|
|
- if [ -f @l_prefix@/var/zebra/${protocol}d.pid ]; then
|
|
|
|
|
- kill -TERM `cat @l_prefix@/var/zebra/${protocol}d.pid` >/dev/null 2>&1 || true
|
|
|
|
|
- fi
|
|
|
|
|
- done
|
|
|
|
|
|
|
+ zebra_stop
|
|
|
|
|
+
|
|
|
|
|
+%restart -p 200 -u @l_susr@
|
|
|
|
|
+ opServiceEnabled zebra || exit 0
|
|
|
|
|
+ zebra_stop
|
|
|
|
|
+ sleep 2
|
|
|
|
|
+ zebra_start
|
|
|
|
|
|