ping某一个网段内的所有在用IP 并用颜色标出

#!/bin/bash

read -p "class network address:" network

for i in {100..130}; do

if ping -c 1 -w 1 $network.$i &> /dev/null; then

echo -e "\033[32m$network.$i\033[0m is up"

else

echo -e "\033[31m$network.$i\033[0m is down"

fi

done


你可能感兴趣的:(ping,IP网段)