On 15 May 2013 16:31, Guido Trotter <[email protected]> wrote:
>
>
>
> On Wed, May 15, 2013 at 3:19 PM, Thomas Thrainer <[email protected]>
> wrote:
>>
>> Interdiff:
>>
>> diff --git a/tools/master-ip-setup b/tools/master-ip-setup
>> index 1be9fc4..d40b4c3 100755
>> --- a/tools/master-ip-setup
>> +++ b/tools/master-ip-setup
>> @@ -63,7 +63,7 @@ start() {
>>  # Stop the master IP
>>  stop() {
>>    if ! ip addr show dev $MASTER_NETDEV | \
>> -        grep "$MASTER_IP/$MASTER_NETMASK"  >/dev/null 2>&1; then
>> +        grep -F " $MASTER_IP/$MASTER_NETMASK"  >/dev/null 2>&1; then
>>      echo "Master IP address not configured on this machine. Doing
>> nothing."
>>      exit 0
>
>
> I would like to *also* do the ping, and if the ping succeeds error out (that
> is, if it is active on another device, and we can't switch it off).

The ping could also succeed if another machine has got the IP address.
For that it's better to check all the network interfaces.

Bernardo

Reply via email to