Skip to content

Instantly share code, notes, and snippets.

@Red5d
Created September 17, 2014 02:04
Show Gist options
  • Save Red5d/a879c57ad087ab081e92 to your computer and use it in GitHub Desktop.
Save Red5d/a879c57ad087ab081e92 to your computer and use it in GitHub Desktop.
# Scan network range (replace with yours) for MAC addresses, compare with previous scan, and report differences with PushBullet.
# Requires pushbullet bash script from https://github.com/Red5d/pushbullet-bash
touch prev-macs.txt
sudo nmap -sP -n 192.168.1.1/24 | grep "MAC Address" | sort > macs.txt
if [ $(diff macs.txt prev-macs.txt) ];then
pushbullet push all note "New network devices: $(diff macs.txt prev-macs.txt)"
fi
mv macs.txt prev-macs.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment