Created
August 5, 2013 15:50
-
-
Save kopertop/6156990 to your computer and use it in GitHub Desktop.
Ping to OnSip servers to see your latency, and report using Blink(1) Control program: http://thingm.com/products/blink-1.html
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
#!/bin/sh | |
GREEN='#00ff00' | |
YELLOW='#ffc000' | |
RED='#ff0000' | |
PTIME="`ping -c 1 sip.onsip.com|grep time=|awk '{split($7,a,"="); split(a[2],b,".");print b[1]}'`" | |
echo "PING TIME: $PTIME" | |
if [ $PTIME -lt 60 ]; | |
then | |
echo "GREEN: $GREEN" | |
elif [ $PTIME -lt 120 ]; | |
then | |
echo "YELLOW: $YELLOW" | |
else | |
echo "RED: $RED" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment