[SCM] CTDB repository - branch master updated - ctdb-1.13-237-g96fdda1

Amitay Isaacs amitay at samba.org
Sun Jul 29 23:25:24 MDT 2012


The branch, master has been updated
       via  96fdda124f5511fb76190e7c7a7f0b98e6b01a31 (commit)
      from  553455b386aa7848a516a921dfc14eb87c8a3fc1 (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 96fdda124f5511fb76190e7c7a7f0b98e6b01a31
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jul 17 20:13:45 2012 +1000

    Eventscripts: Clean up 11.routing
    
    The loops can all be done without cat or grep.
    
    The pair of loops in updateip is combined into a single loop.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

-----------------------------------------------------------------------

Summary of changes:
 config/events.d/11.routing |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/11.routing b/config/events.d/11.routing
index b6093a2..38a0258 100755
--- a/config/events.d/11.routing
+++ b/config/events.d/11.routing
@@ -21,20 +21,19 @@ loadconfig
 
 case "$1" in
     recovered|ipreallocated)
-        cat $CTDB_BASE/static-routes | while read IFACE DEST GW; do
-            ip route add $DEST via $GW dev $IFACE >/dev/null 2>/dev/null
-        done
+        while read iface dest gw; do
+            ip route add "$dest" via "$gw" dev "$iface" >/dev/null 2>&1
+        done <"${CTDB_BASE}/static-routes"
         ;;
 
     updateip)
 	oiface=$2
 	niface=$3
-	cat $CTDB_BASE/static-routes | egrep "^$niface " | while read IFACE DEST GW; do
-	    ip route add $DEST via $GW dev $IFACE >/dev/null 2>/dev/null
-	done
-	cat $CTDB_BASE/static-routes | egrep "^$oiface " | while read IFACE DEST GW; do
-	    ip route add $DEST via $GW dev $IFACE >/dev/null 2>/dev/null
-	done
+	while read iface dest gw; do
+	    if [ "$niface" = "$iface" -o "$oiface" = "$iface" ] ; then
+		ip route add "$dest" via "$gw" dev "$iface" >/dev/null 2>&1
+	    fi
+	done <"${CTDB_BASE}/static-routes"
 	;;
 
     *)


-- 
CTDB repository


More information about the samba-cvs mailing list