]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
during startup make sure to delete any public addresses from any
authorRonnie Sahlberg <sahlberg@ronnie>
Fri, 14 Sep 2007 00:37:10 +0000 (10:37 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Fri, 14 Sep 2007 00:37:10 +0000 (10:37 +1000)
interface

(This used to be ctdb commit 18d80ea6db39e61f60e4c01de164d58bcbd8ab10)

ctdb/config/events.d/10.interface

index aee7d62176428718dcce86e5fbe18113f4cab72d..14d4c648003860e053409ad8103b3066c1b0d7a3 100755 (executable)
@@ -66,6 +66,15 @@ case $cmd in
        [ -f /proc/sys/net/ipv4/conf/all/arp_filter ] && {
            echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
        }
+       cat "$CTDB_PUBLIC_ADDRESSES" | cut -d/ -f1 | while read _IP; do
+               _IP_HELD=`ip addr show | grep "inet $_IP/"`
+               [ -z "$_IP_HELD" ] || {
+                       _IFACE=`echo $_IP_HELD | sed -e "s/.*\s//"`
+                       _NM=`echo $_IP_HELD | sed -e "s/.*$_IP\///" -e "s/\s.*//"`
+                       echo Removing public address "$_IP"/"$_NM" from device "$_IFACE"
+                       ip addr del $_IP/$_NM dev $_IFACE >/dev/null 2>&1
+               }
+       done
        ;;