简单PING测试脚本
这里介绍两个在linux下用脚本进行连通性(ping)测试的脚本。
1,基于连续IP的ping脚本
1 2 3 4 5 6 7 | #!/bin/sh # ip="192.168.3." for i in `seq 1 13` do ping -c 2 $ip$i | grep -q 'ttl=' && echo "$ip$i OK" || echo "$ip$i NOT OK" done |
保存为ping.sh,然后添加权限并执行。
#chmod +x ping.sh
#./ping.sh
脚本ping判断成功与否以是否出现ttl值为准。
2、基于文件中IP列表的测试
首先创建一文本文件,这里命名为iplist,每行有一个IP地址。
1 2 3 | 192.168.3.1 192.168.3.11 192.168.3.111 |
脚本内容
1 2 3 4 5 6 | #!/bin/sh # for i in `cat iplist` do ping -c 1 $i | grep -q 'ttl=' && echo "$i OK" || echo "$i NOT OK" done |
保存为ping.sh,然后添加权限并执行,注意要和iplist在同一目录中。
#chmod +x ping.sh
#./ping.sh
13 条评论
cheap androxal cheap pharmacy
buy androxal generic pharmacy in canada
buying enclomiphene canada mail order
discount enclomiphene generic real
cheapest buy rifaximin canada purchase
buying rifaximin canadian sales
get xifaxan generic is it legal
buy xifaxan generic no prescription
cheap staxyn generic alternatives
discount staxyn no prescription mastercard
purchase avodart usa discount
avodart online pharmacy canada cheap
order dutasteride lowest price
buy cheap dutasteride generic health
buying flexeril cyclobenzaprine usa cheap
buy flexeril cyclobenzaprine cheap generic uk
buy gabapentin buy japan
buy cheap gabapentin without prescriptions uk
fildena without a prescription or doctor
cheapest buy fildena cheap wholesale
get itraconazole cheap online no prescription
get itraconazole australia discount
kamagra přenocování cod bez lékařského předpisu
nákup kamagra v mexiku
sans ordonnance kamagra pharmacie gratuit comprime acheter en ligne
sans ordonnance kamagra envoyer buy online