Hello, I am trying to implement this script, but for some reason, it limits to pinging 192.1681.1 and then 192.168.1.2 infinitely.
Any idea what is wrong with it? Thanks!
Quote:
PREFIX=192.168.1
OCTET=1
while [ "$OCTET" -lt "255" ]; do
echo -en "Pinging ${PREFIX}.${OCTET}..."
ping -c1 -w1 ${PREFIX}.${OCTET}
if [ "$?" -eq "0" ]; then
echo "OK"
else
echo "Failed"
let OCTET=$OCTET+1
fi
done