Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Dota 2 Ping Tester edited by FranzMeister (original code from PlanetSide 2 Ping Tester by Sh4rkill3rSG)
- # IPs copied from http://thebinaryrealm.blogspot.in/2013/10/list-of-ip-addresses-of-all-dota2.html
- # Linux edition
- # Mac compatible
- # script by /u/khoury
- # re-edited by FranzMeister
- # added UAE server
- # changed some IP's to their respective ns
- # changed some abbr.
- uname -a | grep -q Darwin
- if [ $? -eq 0 ]
- then
- PingResultText="round-trip"
- else
- PingResultText="rtt"
- fi
- awkscript_init () {
- echo 'BEGIN { found = 0; t="0" }\
- $1 == "'${PingResultText}'" { found = 1; t = $4; }\
- END { if (found == 1) {\
- split(t, parts, "/");\
- print parts[1];\
- } else\
- print 0\
- }' > awkscript
- }
- dota_ping () {
- ping -c 1 -q $1 > pingfile
- awk -f awkscript pingfile
- }
- dota_ping_end () {
- rm awkscript pingfile
- }
- awkscript_init
- echo ========= DOTA 2 PING TESTER =========
- echo "Result in milliseconds (ms)"
- echo ====================================== && echo South East Asia
- echo "* (SEA) Singapore: $(dota_ping sgp-1.valve.net) ms"
- echo "* (SEA) Singapore: $(dota_ping sgp-2.valve.net) ms"
- echo ====================================== && echo Europe
- echo "* (EU West) Luxembourg: $(dota_ping lux.valve.net) ms"
- echo "* (EU East) Vienna: $(dota_ping vie.valve.net) ms"
- echo ====================================== && echo United States
- echo "* (US West) Seattle: $(dota_ping eat.valve.net) ms"
- echo "* (US East) Sterling: $(dota_ping 208.78.164.1) ms"
- echo ======================================
- echo Australia
- echo "* (AU) Sydney: $(dota_ping syd.valve.net) ms"
- echo ======================================
- echo Russia
- echo "* (SE) Stockholm: $(dota_ping sto.valve.net) ms"
- echo ======================================
- echo South America
- echo "* (BR) Sao Paulo: $(dota_ping 209.197.29.1) ms"
- echo "* (BR) Sao Paulo: $(dota_ping 209.197.25.1) ms"
- echo "* (BR) Sao Paulo: $(dota_ping gru.valve.net) ms"
- echo ======================================
- echo South Africa
- echo "* (ZA) Cape Town: $(dota_ping 197.80.200.1) ms"
- echo "* (ZA) Cape Town: $(dota_ping 196.38.180.1) ms"
- echo ======================================
- echo Middle East
- echo "* (UAE) Dubai: $(dota_ping dxb.valve.net) ms"
- echo ======================================
- echo
- echo "The listed IPs are of one among the servers used in a cluster for all regions,"
- echo "which is enough to approximately determine the ping."
- dota_ping_end
Advertisement
Add Comment
Please, Sign In to add comment