检查ip是否在使用
2015-09-10 12:55
253 查看
cat /tmp/checkaliveip.sh
#!/bin/bash
for num in {1..254}
do
(
Host=192.168.110.$num
# ping -c2 $Host &> /dev/null
ping -c 2 -i 0.2 -w 3 $Host &> /dev/null
[ $? -eq 0 ] && echo -e "# # # # #\t\e[0;5m\e[32m$Host is alive.\e[0m\t# # # # #"
[ $? -ne 0 ] && echo -e "\t\t\t\t\t\t\t\t\t------------\t\e[0;5m\e[4m\e[31m$Host is down.\e[0m\t-------------"
) #&
done
本文出自 “勿忘初心” 博客,请务必保留此出处http://winterysea.blog.51cto.com/9677346/1693405
#!/bin/bash
for num in {1..254}
do
(
Host=192.168.110.$num
# ping -c2 $Host &> /dev/null
ping -c 2 -i 0.2 -w 3 $Host &> /dev/null
[ $? -eq 0 ] && echo -e "# # # # #\t\e[0;5m\e[32m$Host is alive.\e[0m\t# # # # #"
[ $? -ne 0 ] && echo -e "\t\t\t\t\t\t\t\t\t------------\t\e[0;5m\e[4m\e[31m$Host is down.\e[0m\t-------------"
) #&
done
本文出自 “勿忘初心” 博客,请务必保留此出处http://winterysea.blog.51cto.com/9677346/1693405
相关文章推荐
- 0014 sql 基础(1)
- c语言学习二
- UI一揽子计划 13 (UITabBarController 、UITabBar、UITabBarItem 、Block传值)
- oracle用户创建及权限设置
- fs寄存器相关,PEB,TEB
- UI一揽子计划 12 (模态ViewController、单例、通讯录实战、)
- 个推和极光推送技术介绍
- UI一揽子计划 11 (自定义UITableViewCell、Cell 的自适应高度)
- Js读取json数据 && 循环读取JSON数据
- tomcat请求修改为nio处理的配置说明
- UI一揽子计划 10 (UITableView 中cell 的编辑, 增加, 删除、UITableViewController 、)
- UI一揽子计划 9 (UITableView 、UITableView 、重用机制)
- SELECT IN ORDER BY CHARINDEX (排序)
- 同步与异步访问网络
- UI一揽子计划 8 (UINavigationController 、界面通信 、NSTimer 、NSUserDefaults)
- UI一揽子计划 7 ( UIScrollView、 UIPageControl、综合所学简单相册)
- linux系统启动tomcat报错
- UI一揽子计划 6 (UIControl、UISegmentedControl、UIImageView插入数组图片、UISlider)
- UI一揽子计划 5 (Target: Action: 、Protocol Delegate、 UIImageView 、手势识别器)
- PAT-A | 1004 | Counting Leaves