1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

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)
This commit is contained in:
Ronnie Sahlberg 2010-11-10 14:40:43 +11:00
parent 83e68b62dd
commit ebed26d755

View File

@ -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;
}