SHARE
TWEET

Untitled

a guest May 22nd, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. # Dota 2 Ping Tester edited by FranzMeister (original code from PlanetSide 2 Ping Tester by Sh4rkill3rSG)
  4. # IPs copied from http://thebinaryrealm.blogspot.in/2013/10/list-of-ip-addresses-of-all-dota2.html
  5.  
  6. # Linux edition
  7. # Mac compatible
  8.  
  9. uname -a | grep -q Darwin
  10.  
  11. if [ $? -eq 0 ]
  12. then
  13.     PingResultText="round-trip"
  14. else
  15.     PingResultText="rtt"
  16. fi
  17.  
  18. awkscript_init () {
  19.         echo 'BEGIN  { found = 0; t="0" }\
  20.  
  21. $1 == "'${PingResultText}'" { found = 1; t = $4; }\
  22.  
  23. END { if (found == 1) {\
  24.          split(t, parts, "/");\
  25.          print parts[1];\
  26.      } else\
  27.          print 0\
  28. }' > awkscript
  29. }
  30. dota_ping () {
  31.         ping -c 1 -q $1 > pingfile
  32.         awk -f awkscript pingfile
  33. }
  34. dota_ping_end () {
  35.         rm awkscript pingfile
  36. }
  37.  
  38. awkscript_init
  39. echo ========= DOTA 2 PING TESTER =========
  40. echo "Result in milliseconds (ms)"
  41. echo ====================================== && echo South East Asia, Singapore
  42. echo "* (SEA) Singapore: $(dota_ping 103.28.54.1)"
  43. echo "* (SEA) Singapore: $(dota_ping 103.10.124.1)"
  44. echo ====================================== && echo Europe
  45. echo "* (EU West) Luxembourg: $(dota_ping 146.66.152.1)"
  46. echo "* (EU East) Vienna: $(dota_ping 146.66.155.1)"
  47. echo ====================================== && echo United States
  48. echo "* (US West) Washington: $(dota_ping 192.69.96.1)"
  49. echo "* (US East) Sterling: $(dota_ping 208.78.164.1)"
  50. echo ======================================
  51. echo Australia
  52. echo "* (AU) Sydney: $(dota_ping 103.10.125.1)"
  53. echo ======================================
  54. echo Russia
  55. echo "* (SW) Stockholm: $(dota_ping 146.66.156.1)"
  56. echo ======================================
  57. echo South America
  58. echo "* (BR): $(dota_ping 209.197.29.1)"
  59. echo "* (BR): $(dota_ping 209.197.25.1)"
  60. echo ======================================
  61. echo South Africa
  62. echo "* (SA) Cape Town: $(dota_ping 197.80.200.1)"
  63. echo "* (SA) Cape Town: $(dota_ping 196.38.180.1)"
  64. echo ======================================
  65. echo
  66. echo
  67. echo "The listed IPs are of one among the servers used in a cluster for all regions, which is enough to approximately determine the ping."
  68. dota_ping_end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top