3 #################################
4 # interface event script for ctdb
5 # this adds/removes IPs from your
14 #############################
15 # called when ctdbd starts up
20 ################################################
21 # called when ctdbd wants to claim an IP address
24 echo "must supply interface, IP and maskbits"
31 # we make sure the interface is up first
32 /sbin/ip link set $iface up || {
33 echo "`/bin/date` Failed to bringup interface $iface"
36 /sbin/ip addr add $ip/$maskbits dev $iface || {
37 echo "`/bin/date` Failed to add $ip/$maskbits on dev $iface"
41 # flush our route cache
42 echo 1 > /proc/sys/net/ipv4/route/flush
46 ##################################################
47 # called when ctdbd wants to release an IP address
50 echo "`/bin/date` must supply interface, IP and maskbits"
56 /sbin/ip addr del $ip dev $iface || {
57 echo "`/bin/date` Failed to del $ip on dev $iface"
61 # flush our route cache
62 echo 1 > /proc/sys/net/ipv4/route/flush
66 ###########################################
67 # called when ctdbd has finished a recovery
71 ####################################
72 # called when ctdbd is shutting down