Chinaunix首页 | 论坛 | 博客
  • 博客访问: 12394
  • 博文数量: 9
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 56
  • 用 户 组: 普通用户
  • 注册时间: 2014-12-12 13:58
文章分类
文章存档

2015年(5)

2014年(4)

我的朋友

分类: LINUX

2014-12-12 14:22:52

  1 
  2 #!/bin/bash
  3 
  4 #This shell is used to test the network
  5 export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/mysql/bin:/root/bin:
  6 #dingyi cheng gong ping tong de dizhi
  7 s=0
  8 #dingyi shi bai ping tong de dizhi
  9 f=0
 10 #ding yi xu yao ping de IP dizhi
 11 IPADDR="10.216.254"
 12 #shijian
 13 Date=`date +%F`
 14 cat <  15 ---------------------Date 2014.12.5-----------------------------
 16 -------------The scipt is used to test the network--------------
 17 -----------The test is running,please wait a moment!------------
 18 help
 19 for I in {30..40};do 
 20         ping -c 1 -w 2 ${IPADDR}.${I} >/tmp/ping
 21         if [ $? == 0 ];then
 22                 {
 23                 echo "${IPADDR}.${I} connect success!:${Date}" >>/tmp/tongji
 24                 s=$[s+1]
 25                 }
 26         
 27         else    
 28                 {
 29                 echo "${IPADDR}.${I} connect failure!:${Date}" >>/tmp/tongji
 30                 f=$[f+1]
 31                 }
 32         fi
 33         done
 34 echo "The number of success connect is $s !"
 35 echo "The number of failure connect is $f !"
阅读(270) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:tcpdump抓包规则命令大全

给主人留下些什么吧!~~