- ONLINE: 71
- OFFLINE: 183
- ONLINE: 85
- OFFLINE: 169
#!/usr/bin/env bash | |
# q&d; WTFPL; | |
count_off=0; | |
count_onl=0; | |
for n in {1..254}; do | |
ip="151.236.12.${n}"; | |
ping -c1 -t1 ${ip} > /dev/null 2>&1 | |
if [ $? -eq 0 ]; then | |
$[count_onl+=1] 2> /dev/null; | |
echo -e "${ip}:\tONLINE"; | |
else | |
$[count_off+=1] 2> /dev/null; | |
echo -e "${ip}:\tOFFLINE"; | |
fi | |
done | |
echo "====== STATS ======" | |
echo "ONLINE: ${count_onl}" | |
echo "OFFLINE: ${count_off}" | |
echo "===================" |