Created
November 20, 2021 18:11
-
-
Save gfrn/1aeb0149d481fc78d9d34c82381b87a5 to your computer and use it in GitHub Desktop.
Get possible IPs for new devices in network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -p "Enter your network mask: " | |
IP=${REPLY} | |
OLD=$(nmap -sn $IP | grep 'Nmap scan report for' | cut -f 5 -d ' ') | |
read -n 1 -p "Plug in the device and press enter" | |
NEW=$(nmap -sn $IP | grep 'Nmap scan report for' | cut -f 5 -d ' ') | |
echo Possible IPs: | |
echo ${OLD[@]} ${NEW[@]} | tr ' ' '\n' | sort | uniq -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment