首页 > 其他 > 详细

检查ip是否在使用

时间:2015-09-10 17:40:25      阅读:225      评论:0      收藏:0      [点我收藏+]




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##########\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---------------\t\e[0;5m\e[4m\e[31m$Host is down.\e[0m\t-----------------"

) #&

done





本文出自 “勿忘初心” 博客,请务必保留此出处http://winterysea.blog.51cto.com/9677346/1693405

检查ip是否在使用

原文:http://winterysea.blog.51cto.com/9677346/1693405

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!