#!/bin/bash

# This user-defined script is called by IPwatchD daemon when IP conflict occurs.
# Feel free to modify it to suit your needs.

# Name of network device in conflict
DEVICE=$1

# IP address in conflict
IP=$2

# MAC address of conflicting system
MAC=$3

curl -H "Content-Type: application/json" -X POST -d '{"conflict": true, "mac": "'$MAC'"}' "http://127.0.0.1:8080/api/v1/network/report-status/"
# send GARP after defend-interval (10s)
/opt/rocware/c9/arping-after-ipconflict.sh $IP &

exit 0

