|
|
|
|
@ -6,41 +6,58 @@
|
|
|
|
|
%config |
|
|
|
|
zebra_enable="$openpkg_rc_def" |
|
|
|
|
zebra_protocols="rip ospf bgp" |
|
|
|
|
zebra_log_prolog="true" |
|
|
|
|
zebra_log_epilog="true" |
|
|
|
|
zebra_log_numfiles="10" |
|
|
|
|
zebra_log_minsize="1M" |
|
|
|
|
zebra_log_complevel="9" |
|
|
|
|
|
|
|
|
|
%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 |
|
|
|
|
%status -u @l_susr@ -o |
|
|
|
|
zebra_usable="unknown" |
|
|
|
|
zebra_active="no" |
|
|
|
|
if [ -f @l_prefix@/var/zebra/zebra.pid ]; then |
|
|
|
|
kill -0 `cat @l_prefix@/var/zebra/zebra.pid` >/dev/null 2>&1 || true |
|
|
|
|
if [ $? -eq 0 ]; then |
|
|
|
|
zebra_active="yes" |
|
|
|
|
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 |
|
|
|
|
} |
|
|
|
|
fi |
|
|
|
|
echo "zebra_enable=\"$zebra_enable\"" |
|
|
|
|
echo "zebra_usable=\"$zebra_usable\"" |
|
|
|
|
echo "zebra_active=\"$zebra_active\"" |
|
|
|
|
|
|
|
|
|
%start -p 200 -u @l_susr@ |
|
|
|
|
opService zebra enable yes || exit 0 |
|
|
|
|
zebra_start |
|
|
|
|
rcService zebra enable yes || 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 |
|
|
|
|
|
|
|
|
|
%stop -p 200 -u @l_susr@ |
|
|
|
|
opService zebra enable yes || exit 0 |
|
|
|
|
zebra_stop |
|
|
|
|
rcService zebra enable yes || 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 |
|
|
|
|
|
|
|
|
|
%restart -p 200 -u @l_susr@ |
|
|
|
|
opService zebra enable yes || exit 0 |
|
|
|
|
zebra_stop |
|
|
|
|
sleep 2 |
|
|
|
|
zebra_start |
|
|
|
|
rcService zebra enable yes || exit 0 |
|
|
|
|
rc zebra stop; sleep 1 |
|
|
|
|
rc zebra start |
|
|
|
|
|
|
|
|
|
%daily -u @l_susr@ |
|
|
|
|
rcService zebra enable yes || exit 0 |
|
|
|
|
shtool rotate -f \ |
|
|
|
|
-n ${zebra_log_numfiles} -s ${zebra_log_minsize} -d \ |
|
|
|
|
-z ${zebra_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \ |
|
|
|
|
-P "${zebra_log_prolog}" \ |
|
|
|
|
-E "${zebra_log_epilog}" \ |
|
|
|
|
@l_prefix@/var/zebra/zebra.log |
|
|
|
|
|
|
|
|
|
|