Revision 71b75e7a tools/master-ip-setup

b/tools/master-ip-setup
23 23
USAGE_MSG="Usage: $0 {start|stop}"
24 24
PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
25 25

  
26
FPING_PACKET_COUNT=1
27

  
26 28
# Start the master IP
27 29
start() {
28 30
  case $CLUSTER_IP_VERSION in
......
39 41
  esac
40 42

  
41 43
  # Check if the master IP address is already configured on this machine
42
  if fping -S 127.0.0.1 $MASTER_IP >/dev/null 2>&1; then
44
  if fping -c $FPING_PACKET_COUNT -S 127.0.0.1 $MASTER_IP >/dev/null 2>&1; then
43 45
    echo "Master IP address already configured on this machine. Doing nothing."
44 46
    exit 0
45 47
  fi
46 48

  
47 49
  # Check if the master IP address is already configured on another machine
48
  if fping $MASTER_IP >/dev/null 2>&1; then
50
  if fping -c $FPING_PACKET_COUNT $MASTER_IP >/dev/null 2>&1; then
49 51
    echo "Error: master IP address configured on another machine." >&2
50 52
    exit 1
51 53
  fi
......
66 68
  if ! ip addr show dev $MASTER_NETDEV | \
67 69
     grep -F " $MASTER_IP/$MASTER_NETMASK" >/dev/null 2>&1; then
68 70
    # 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
71
    if fping -c $FPING_PACKET_COUNT -S 127.0.0.1 $MASTER_IP >/dev/null 2>&1; then
70 72
      echo "Error: master IP address configured on wrong device," \
71 73
           "can't shut it down." >&2
72 74
      exit 1

Also available in: Unified diff