Created
December 22, 2015 07:37
-
-
Save rskelley9/75084dffccdb7dc4b5da to your computer and use it in GitHub Desktop.
Scan for other computers on LAN
This file contains hidden or 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
echo -e "\nScan LAN for other computers.\n" | |
if [ -n ""$@"" ]; then | |
ip=$(/sbin/ifconfig $1 | grep 'inet ' | awk '{ print $2}' | cut -d"." -f1,2,3 ) | |
nmap -sP $ip.1-255 | |
else | |
echo "Enter Interface parameter ex:" | |
echo -e "\t./scannetwork.sh $(ifconfig -lu | awk '{print $2}')\n" | |
echo "Available interfaces: " | |
for i in $(ifconfig -lu) | |
do | |
echo -e "\033[32m \t $i \033[39;49m" | |
done | |
echo "Down interfaces: " | |
for i in $(ifconfig -ld) | |
do | |
echo -e "\033[31m \t $i \033[39;49m" | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment