pingscan
parent
e2466ddc8f
commit
4d8ff7d7b8
|
@ -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
|
Loading…
Reference in New Issue