events.d/11.routing: handle "updateip" event
authorStefan Metzmacher <metze@samba.org>
Tue, 19 Oct 2010 17:21:23 +0000 (19:21 +0200)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 21 Oct 2010 00:09:46 +0000 (11:09 +1100)
metze

config/events.d/11.routing

index c265c382d0c60008ab7043ed57dd3ce728a5ea74..9a1fdef788d9279dd237c7a8e2e2a9f706cb69dc 100755 (executable)
@@ -27,6 +27,17 @@ case "$1" in
        done
        ;;
 
+    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
+       ;;
+
     *)
        ctdb_standard_event_handler "$@"
        ;;