Revision 7f965aea
b/tools/master-ip-setup | ||
---|---|---|
62 | 62 |
|
63 | 63 |
# Stop the master IP |
64 | 64 |
stop() { |
65 |
# Check if the master IP address is still configured on this machine |
|
66 |
if ! ip addr show dev $MASTER_NETDEV | \ |
|
67 |
grep -F " $MASTER_IP/$MASTER_NETMASK" >/dev/null 2>&1; then |
|
68 |
# Check if the master IP address is configured on a wrong device |
|
69 |
if fping -S 127.0.0.1 $MASTER_IP >/dev/null 2>&1; then |
|
70 |
echo "Error: master IP address configured on wrong device," \ |
|
71 |
"can't shut it down." >&2 |
|
72 |
exit 1 |
|
73 |
else |
|
74 |
echo "Master IP address not configured on this machine. Doing nothing." |
|
75 |
exit 0 |
|
76 |
fi |
|
77 |
fi |
|
78 |
|
|
65 | 79 |
if ! ip addr del $MASTER_IP/$MASTER_NETMASK dev $MASTER_NETDEV; then |
66 | 80 |
echo "Error during the deactivation of the master IP address" >&2 |
67 | 81 |
exit 1 |
Also available in: Unified diff