master
zeus 2021-01-24 16:17:50 +01:00
parent e2466ddc8f
commit 4d8ff7d7b8
1 changed files with 13 additions and 0 deletions

13
almost_oneliners/pingscan.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
# ping-scan subnet without other fancy tools
for i in $1.{1..255}
do
if
ping -c 1 -W 1 $i >/dev/null
then
echo "$i: online, hostname: $(host $i | cut -d " " -f 5)"
else
[[ $2 = offlinealso ]] && echo "$i: offline, hostname: $(host $i | cut -d " " -f 5)"
fi
done
exit 0