Преглед на файлове

provide restart command

Ralf S. Engelschall преди 22 години
родител
ревизия
582d3b1a43
променени са 2 файла, в които са добавени 32 реда и са изтрити 18 реда
  1. 31 17
      zebra/rc.zebra
  2. 1 1
      zebra/zebra.spec

+ 31 - 17
zebra/rc.zebra

@@ -7,26 +7,40 @@
     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
-    ( 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@
     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
 

+ 1 - 1
zebra/zebra.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [BASE]
 Group:        Network
 License:      GPL
 Version:      0.93b
-Release:      20030328
+Release:      20030408
 
 #   list of sources
 Source0:      ftp://ftp.zebra.org/pub/zebra/zebra-%{version}.tar.gz