#!/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

wKioL1g0SObQ4TbvAAASGm7HwNE932.png-wh_50