设为首页 加入收藏

TOP

自动化ping
2013-02-08 15:11:20 】 浏览:763
Tags:自动化 ping
  查看是否ping通网站
  [cpp]
  #!/bin/bash
  #Checks to see if hosts 192.168.1.100-192.168.1.200 are alive
  for n in {100200}; do
  host=192.168.1.$n
  ping -c 2 $host >/dev/null
  if [ $ = 0 ]; then
  echo "$host is UP"
  else
  echo "$host is DOWN"
  fi
  done
  读网站文本
  [cpp]
  #!/bin/bash
  while read host
  do
  ping -c 2 $host >/dev/null
  if [ $ = 0 ]
  then
  echo "$host"
  else
  echo "$hostN"
  fi
  done < domain.txt

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇作为pthread_create参数 下一篇Fibnacci序列(递归方法)

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目