#!/bin/bash
echo "###The script is begining to execute###"
server_ip=`cat /root/ip.txt`
for ip in $server_ip;do
  ping -c2 $ip &>/dev/null
  if [ $? -eq 0 ];then
    echo "$ip   connect" >> /tmp/`date +%F`_ip.txt
  else
    echo "$ip   disconnect" >> /tmp/`date +%F`_ip.txt
  fi
done
echo "###The script is finsihed to execute###"
