Skip to content

Instantly share code, notes, and snippets.

@ikanoano
Created December 25, 2018 21:13
Show Gist options
  • Save ikanoano/3f716166adc6b321a1d90ee5c9b7f156 to your computer and use it in GitHub Desktop.
Save ikanoano/3f716166adc6b321a1d90ee5c9b7f156 to your computer and use it in GitHub Desktop.
#!/bin/sh
cnt=1;
zero=`date +%s`
ping -4 -i1 $(ip) | while read line; do
line=`echo $line | awk -F= '{print $4}'`
now=$((`date +%s` - $zero))
timestamp="$(( $now/3600 )):$(( ($now/60)%60 )):$(( $now%60 ))"
timestamp="$timestamp,000 --> $timestamp,999"
echo $cnt
echo $timestamp
echo $line
echo ""
cnt=$((cnt+1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment