You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
##
## rc.zebra -- Run-Commands
##
%config
zebra_enable="yes"
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@
opServiceEnabled zebra || exit 0
zebra_start
%stop -p 200 -u @l_susr@
opServiceEnabled zebra || exit 0
zebra_stop
%restart -p 200 -u @l_susr@
opServiceEnabled zebra || exit 0
zebra_stop
sleep 2
zebra_start