diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-11-10 14:40:43 +1100 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-11-10 14:55:25 +1100 |
commit | ebed26d7556b51dfd6973b20838cbe9128a976c8 (patch) | |
tree | a323830861145263a298d8ba5018860c4f5ae2f8 | |
parent | 83e68b62dd60653342cca21a88617514be4d9f38 (diff) | |
download | samba-ebed26d7556b51dfd6973b20838cbe9128a976c8.tar.gz samba-ebed26d7556b51dfd6973b20838cbe9128a976c8.tar.xz samba-ebed26d7556b51dfd6973b20838cbe9128a976c8.zip |
delete from old interface before adding to new interface
this stops the script from failing with an error if
both interfaces are specified as the same, which otherwise breaks and leads to an infinite recovery loop
(This used to be ctdb commit 565de03a784ed441490f8cd0b137b5cec8716d55)
-rwxr-xr-x | ctdb/config/events.d/10.interface | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface index c6b871f837..5b31fb8109 100755 --- a/ctdb/config/events.d/10.interface +++ b/ctdb/config/events.d/10.interface @@ -244,14 +244,13 @@ case "$1" in iptables -D INPUT -i $oiface -d $ip -j DROP 2> /dev/null iptables -I INPUT -i $oiface -d $ip -j DROP - # we make sure the interface is up first - add_ip_to_iface $niface $ip $maskbits || { + delete_ip_from_iface $oiface $ip $maskbits || { + delete_ip_from_iface $niface $ip $maskbits iptables -D INPUT -i $oiface -d $ip -j DROP 2> /dev/null exit 1; } - delete_ip_from_iface $oiface $ip $maskbits || { - delete_ip_from_iface $niface $ip $maskbits + add_ip_to_iface $niface $ip $maskbits || { iptables -D INPUT -i $oiface -d $ip -j DROP 2> /dev/null exit 1; } |