#!/bin/bash
#http://wangjiatong.blog.51cto.com/
#create2016-11-22
ping_success(){
if ping -c 1 $IP >/dev/null; then
echo -e "\033[032m$IP ping issuccessful!!\033[0m"
continue
fi
}
IP_LIST="192.168.217.130192.168.217.142"
for IP in$IP_LIST;
do
ping_success
sleep 1
ping_success
echo -e "\033[031m$IP ping isfailure!\033[0m"
done
时间: 2024-10-08 21:16:56