Last active
October 28, 2023 11:41
-
-
Save manesec/9854551b706b675926350bffd55858ff to your computer and use it in GitHub Desktop.
Use for Ping Monitor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface="$(ip tuntap show | cut -d : -f1 | head -n 1)" | |
ip=`ip -j route list table all | jq -r '.[] | select(.dev=="'$interface'") | .gateway' | grep -v null | head -n 1` | |
ping $ip -W 1 -c 1| awk -F'/' 'END{ print (/^rtt/? " - "$5" ms":"") }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment