Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 3e3c8f05d5b01d5f541fb1751a3395b8 > files > 7

ctdb-1.2.46-4.mga4.x86_64.rpm

#!/bin/sh
# script to add entries to the routing table after we have performed a
# take ip event
# (when we do a "releaseip" event and remove an ip address from an interface
#  the kernel might automatically remove associated entries from
#  the routing table. This is where we add them back)
#
# Routes to add are defined in /etc/ctdb/static-routes.
# Syntax is :
# IFACE NET/MASK GATEWAY
#
# Example
# bond1 10.3.3.0/24 10.0.0.1

. $CTDB_BASE/functions
loadconfig

[ -f $CTDB_BASE/static-routes ] || {
    exit 0
}

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
        ;;
    *)
	ctdb_standard_event_handler "$@"
	;;
esac

exit 0