命令:
nmap -sP 192.168.0.0/24
脚本
#!/bin/bash
for I in `seq 1 255`
do
ping -c 2 -W 2 10.0.0.$I &>/dev/null
if [ $? -eq 0 ]
then
echo -e "10.0.0.$I is up."
else
echo -e "10.0.0.$I is down."
fi
done
命令:
nmap -sP 192.168.0.0/24
脚本
#!/bin/bash
for I in `seq 1 255`
do
ping -c 2 -W 2 10.0.0.$I &>/dev/null
if [ $? -eq 0 ]
then
echo -e "10.0.0.$I is up."
else
echo -e "10.0.0.$I is down."
fi
done