I'm trying to create a script to check if my router's IP to MAC address has changed from the view of my computer. Basically trying to check if a MITM attack is taking place. I cannot get this to work; the IP 172.16.213.254 is my gateway IP.
arp -a 172.16.213.254 | cut -d" " -f 4 >> routersmac.txt
if [[ cat routersmac.txt = "00:01:32:23:23:23"]]
then
echo "You are safe"
else
echo "MITM in progress"
fi