From: Stefan Metzmacher Date: Tue, 19 Oct 2010 17:21:23 +0000 (+0200) Subject: events.d/11.routing: handle "updateip" event X-Git-Url: http://git.samba.org/?p=metze%2Fctdb%2Fwip.git;a=commitdiff_plain;h=034635418c7e5274d6bdf4cccc7a10e3b631e2d4 events.d/11.routing: handle "updateip" event metze --- diff --git a/config/events.d/11.routing b/config/events.d/11.routing index c265c382..9a1fdef7 100755 --- a/config/events.d/11.routing +++ b/config/events.d/11.routing @@ -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 "$@" ;;