#!/bin/bash
#ping local network
# Read IP Lists, Way I
#for ip in 192.168.1.{1..255};
# Read IP Lists, Way II
for ip in `cat iplist`;
do
ping $ip -c 2 &> /dev/null;
if [ $? -eq 0 ];
then
echo $ip is alive
fi
done
时间: 2024-10-07 13:46:19
#!/bin/bash
#ping local network
# Read IP Lists, Way I
#for ip in 192.168.1.{1..255};
# Read IP Lists, Way II
for ip in `cat iplist`;
do
ping $ip -c 2 &> /dev/null;
if [ $? -eq 0 ];
then
echo $ip is alive
fi
done