0
4# lishiming2009
#!/bin/bash
#program
# use ping command to check the network's pc state
#history
#2009/02/18 vbird first release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~bin
export PATH
network="192.168.202"
for sitenu in $(seq 1 100)
do
ping -c 1 -w 1 ${network}.${sitenu} &> /dev/null && result=0 ||
result=1
if [ "$result" == 0 ]; then
echo "server ${network}.${sitenu} is UP."
else
echo "server ${network}.${sitenu} is down."
fi
done
鸟哥书上417页上的脚本
我只是把网段修改了下
#!/bin/bash
#program
# use ping command to check the network's pc state
#history
#2009/02/18 vbird first release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~bin
export PATH
network="192.168.202"
for sitenu in $(seq 1 100)
do
ping -c 1 -w 1 ${network}.${sitenu} &> /dev/null && result=0 ||
result=1
if [ "$result" == 0 ]; then
echo "server ${network}.${sitenu} is UP."
else
echo "server ${network}.${sitenu} is down."
fi
done
鸟哥书上417页上的脚本
我只是把网段修改了下
编辑回复