frzmstr

DotA2 Ping Tester Mac FranzMeister | pingle-bells

Dec 24th, 2014
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.40 KB | None | 0 0
  1. #!/bin/sh
  2. # Dota 2 Ping Tester edited by FranzMeister (original code from PlanetSide 2 Ping Tester by Sh4rkill3rSG)
  3. # IPs copied from http://thebinaryrealm.blogspot.in/2013/10/list-of-ip-addresses-of-all-dota2.html
  4. # Linux edition
  5. # Mac compatible
  6.  
  7. # script by /u/khoury
  8. # re-edited by FranzMeister
  9. # added UAE server
  10. # changed some IP's to their respective ns
  11. # changed some abbr.
  12.  
  13. uname -a | grep -q Darwin
  14.  
  15. if [ $? -eq 0 ]
  16. then
  17. PingResultText="round-trip"
  18. else
  19. PingResultText="rtt"
  20. fi
  21. awkscript_init () {
  22. echo 'BEGIN { found = 0; t="0" }\
  23. $1 == "'${PingResultText}'" { found = 1; t = $4; }\
  24. END { if (found == 1) {\
  25. split(t, parts, "/");\
  26. print parts[1];\
  27. } else\
  28. print 0\
  29. }' > awkscript
  30. }
  31. dota_ping () {
  32. ping -c 1 -q $1 > pingfile
  33. awk -f awkscript pingfile
  34. }
  35. dota_ping_end () {
  36. rm awkscript pingfile
  37. }
  38. awkscript_init
  39. echo ========= DOTA 2 PING TESTER =========
  40. echo "Result in milliseconds (ms)"
  41. echo ====================================== && echo South East Asia
  42. echo "* (SEA) Singapore: $(dota_ping sgp-1.valve.net) ms"
  43. echo "* (SEA) Singapore: $(dota_ping sgp-2.valve.net) ms"
  44. echo ====================================== && echo Europe
  45. echo "* (EU West) Luxembourg: $(dota_ping lux.valve.net) ms"
  46. echo "* (EU East) Vienna: $(dota_ping vie.valve.net) ms"
  47. echo ====================================== && echo United States
  48. echo "* (US West) Seattle: $(dota_ping eat.valve.net) ms"
  49. echo "* (US East) Sterling: $(dota_ping 208.78.164.1) ms"
  50. echo ======================================
  51. echo Australia
  52. echo "* (AU) Sydney: $(dota_ping syd.valve.net) ms"
  53. echo ======================================
  54. echo Russia
  55. echo "* (SE) Stockholm: $(dota_ping sto.valve.net) ms"
  56. echo ======================================
  57. echo South America
  58. echo "* (BR) Sao Paulo: $(dota_ping 209.197.29.1) ms"
  59. echo "* (BR) Sao Paulo: $(dota_ping 209.197.25.1) ms"
  60. echo "* (BR) Sao Paulo: $(dota_ping gru.valve.net) ms"
  61. echo ======================================
  62. echo South Africa
  63. echo "* (ZA) Cape Town: $(dota_ping 197.80.200.1) ms"
  64. echo "* (ZA) Cape Town: $(dota_ping 196.38.180.1) ms"
  65. echo ======================================
  66. echo Middle East
  67. echo "* (UAE) Dubai: $(dota_ping dxb.valve.net) ms"
  68. echo ======================================
  69. echo
  70. echo "The listed IPs are of one among the servers used in a cluster for all regions,"
  71. echo "which is enough to approximately determine the ping."
  72. dota_ping_end
Advertisement
Add Comment
Please, Sign In to add comment