#!/bin/bash
ip=$1
if [ -z $ip ]; then
  echo "usage: ./ping_test.sh [ip]"
  exit 1
fi
log_path="./ping_test.log"
while :
do
  echo `date '+%Y%m%d-%H%M%S'` >> $log_path
  ping -c 1 -W 5 $ip >> $log_path
  sleep 10
done

