Lizard1003

[macOS] Yota Mobile Access Full v1.0

May 23rd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.43 KB | None | 0 0
  1. #!/bin/sh
  2. #by Lizard, from osxpc.ru team
  3. #Yota Mobile Access.sh
  4. #Version: "1.0 full"
  5.  
  6. #Value for you edit:
  7. macttl=64  #macOS     (recovery default value)
  8. iosttl=65  #iOS       (for Instant hotspot, Wi-Fi hotspot and USB connection)
  9. andttl=65  #Android   (for Wi-Fi hotspot and USB connection)
  10. wphttl=129 #Win Phone (for Wi-Fi hotspot)
  11. #All done.
  12.  
  13. #Dosen't change code below this comment.
  14. sw0=$(sw_vers -productName)
  15. sw1=$(sw_vers -productVersion)
  16. sw2=$(sw_vers -buildVersion)
  17. reset
  18. echo =========================================================
  19. echo Yota Mobile Access.sh
  20. echo =========================================================
  21. echo
  22. echo Version     : "1.0 full"
  23. echo Supported   : "macOS, iOS, Android, Windows Phone, and custom value."
  24. echo System      : "$sw0 $sw1 $sw2"
  25. echo
  26. echo Description : "If your provider blocked Wi-Fi or USB hotspot on device, you can try this soliution."
  27. echo "This script increase TTL value for your device, and Internet provider doesn't understand that connection is going outside the device."
  28. echo
  29. echo =======================================================
  30. echo
  31. ttl0=$(sysctl net.inet.ip.ttl | cut -c 18-)
  32. if [ $ttl0 = '64' ]; then
  33.         echo "Current TTL = 64. This TTL value is default value for macOS."
  34. fi
  35. if [ $ttl0 = '65' ]; then
  36.         echo "Current TTL = 65. This TTL value is a good choice for iOS and Android."
  37.         echo "Do you want continue anyway? [y/n]: \c"
  38.         read anyway
  39.         if [ $anyway = 'n' ]; then
  40.             echo
  41.             echo Aborting...
  42.             echo
  43.             sleep 1.5
  44.             echo =========================================================
  45.             echo All done. Have a nice day!
  46.             echo
  47.             echo Always for you, osxpc.ru team.
  48.             echo =========================================================
  49.             echo
  50.             echo "Close this session in 10 seconds..."
  51.             sleep 10
  52.             echo
  53.             exit
  54.         fi
  55. fi
  56. if [ $ttl0 = '129' ]; then
  57.         echo "Current TTL = 129. This TTL value is a good choice for Windows Phone."
  58.         echo "Do you want continue anyway? [y/n]: \c"
  59.         read anyway
  60.         if [ $anyway = 'n' ]; then
  61.             echo
  62.             echo Aborting...
  63.             echo
  64.             sleep 1.5
  65.             echo =========================================================
  66.             echo All done. Have a nice day!
  67.             echo
  68.             echo Always for you, osxpc.ru team.
  69.             echo =========================================================
  70.             echo
  71.             echo "Close this session in 10 seconds..."
  72.             sleep 10
  73.             echo
  74.             exit
  75.         fi
  76. fi
  77. if [ $ttl0 != '64' ]; then
  78.     if [ $ttl0 != '65' ]; then
  79.         if [ $ttl0 != '129' ]; then
  80.             if [ $ttl0 -lt 64 ]; then
  81.                 echo "!!!"
  82.                 echo "Current TTL = $ttl0. This TTL value has nothing to do with anything, but it needs to be increased minimal to 64 (and greater)."
  83.                 echo "!!!"
  84.             fi
  85.             if [ $ttl0 -gt 64 ]; then
  86.                 echo "Current TTL = $ttl0. This TTL value has nothing to do with anything, but it does not require any changes."
  87.                 echo "Do you want continue anyway? [y/n]: \c"
  88.                 read anyway
  89.                 if [ $anyway = 'n' ]; then
  90.                     echo
  91.                     echo Aborting...
  92.                     echo
  93.                     sleep 1.5
  94.                     echo =========================================================
  95.                     echo All done. Have a nice day!
  96.                     echo
  97.                     echo Always for you, osxpc.ru team.
  98.                     echo =========================================================
  99.                     echo
  100.                     echo "Close this session in 10 seconds..."
  101.                     sleep 10
  102.                     echo
  103.                     exit
  104.                 fi
  105.             fi
  106.            
  107.         fi
  108.     fi
  109. fi
  110. echo
  111. echo =======================================================
  112. echo
  113. echo "Supported Platforms:"
  114. echo
  115. echo "0 — macOS       (recovery default value)"
  116. echo "1 — iOS         (for Instant hotspot, Wi-Fi hotspot and USB connection)"
  117. echo "2 — Android     (for Wi-Fi hotspot and USB connection)"
  118. echo "3 — Win Phone   (for Wi-Fi hotspot)"
  119. echo "4 — Custom TTL  (for technical specialists or test)"
  120. echo "5 — Abort       (just aborted executing this script)"
  121. echo
  122. echo "Enter number platform: \c"
  123. read platform
  124. if [ $platform = '0' ]; then
  125.     echo Changed platform: macOS
  126. fi
  127. if [ $platform = '1' ]; then
  128.     echo Changed platform: iOS
  129. fi
  130. if [ $platform = '2' ]; then
  131.     echo Changed platform: Android
  132. fi
  133. if [ $platform = '3' ]; then
  134.     echo Changed platform: Windows Phone
  135. fi
  136. if [ $platform = '4' ]; then
  137.     echo Changed platform: Custom TTL
  138. fi
  139. if [ $platform = '5' ]; then
  140.     echo
  141.     echo Aborting...
  142.     echo
  143.     sleep 1.5
  144.     echo =========================================================
  145.     echo All done. Have a nice day!
  146.     echo Reconnect your device and get Internet!
  147.     echo
  148.     echo Always for you, osxpc.ru team.
  149.     echo =========================================================
  150.     echo
  151.     echo "Close this session in 10 seconds..."
  152.     sleep 10
  153.     echo
  154.     exit
  155. fi
  156. echo
  157. echo =========================================================
  158. echo
  159. if [ $platform = '0' ]; then
  160.     echo "Set TTL value for macOS"
  161.     sudo sysctl net.inet.ip.ttl=$macttl | cut -c 30-
  162.     ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
  163.     if [ $ttl1 = $macttl ]; then
  164.             echo "Success! Now TTL = $ttl1"
  165.         else
  166.             echo "Error. TTL doesn't changed."
  167.     fi
  168. fi
  169. if [ $platform = '1' ]; then
  170.     echo "Set TTL value for iOS"
  171.     sudo sysctl net.inet.ip.ttl=$iosttl | cut -c 30-
  172.     ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
  173.     if [ $ttl1 = $iosttl ];
  174.         then
  175.             echo "Success! Now TTL = $ttl1"
  176.         else
  177.             echo "Error. TTL doesn't changed."
  178.     fi
  179. fi
  180. if [ $platform = '2' ]; then
  181.     echo "Set TTL value for Android"
  182.     sudo sysctl net.inet.ip.ttl=$andttl | cut -c 30-
  183.     ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
  184.     if [ $ttl1 = $andttl ];
  185.         then
  186.             echo "Success! Now TTL = $ttl1"
  187.         else
  188.             echo "Error. TTL doesn't changed."
  189.     fi
  190. fi
  191. if [ $platform = '3' ]; then
  192.     echo "Set TTL value for Windows Phone"
  193.     sudo sysctl net.inet.ip.ttl=$wphttl | cut -c 30-
  194.     ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
  195.     if [ $ttl1 = $wphttl ];
  196.         then
  197.             echo "Success! Now TTL = $ttl1"
  198.         else
  199.             echo "Error. TTL doesn't changed."
  200.     fi
  201. fi
  202. if [ $platform = '4' ]; then
  203.     echo "What TTL value need assigning?"
  204.     echo "Set TTL value = \c"
  205.     read customttl
  206.     sudo sysctl net.inet.ip.ttl=$customttl | cut -c 30-
  207.     ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
  208.     if [ $ttl1 = $customttl ];
  209.         then
  210.             echo "Success! Now TTL = $ttl1"
  211.         else
  212.             echo "Error. TTL doesn't changed."
  213.     fi
  214. fi
  215. echo
  216. echo =========================================================
  217. echo All done. Have a nice day!
  218. echo Reconnect your device and get Internet!
  219. echo
  220. echo Always for you, osxpc.ru team.
  221. echo =========================================================
  222. echo
  223. echo "Close this session in 10 seconds..."
  224. sleep 10
  225. echo
  226. exit
Add Comment
Please, Sign In to add comment