检查主机存活状态脚本

#!/bin/bash
ping_success_status() {
        if ping -c 1 $IP >/dev/null;then
                echo "$IP Ping is successful!"
                continue
        fi
}
IP_LIST="192.168.164.1 58.87.108.139"
for IP in $IP_LIST;do
        ping_success_status
        ping_success_status
        ping_success_status
        echo "$IP Ping is failure!"
done

 

posted @ 2019-03-16 12:43  New_Journey  阅读(351)  评论(0编辑  收藏  举报