Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #by Lizard, from osxpc.ru team
- #Yota Mobile Access.sh
- #Version: "1.0 dbg"
- #Value for you edit:
- macttl=64 #macOS (recovery default value)
- iosttl=65 #iOS (for Instant hotspot, Wi-Fi hotspot and USB connection)
- andttl=65 #Android (for Wi-Fi hotspot and USB connection)
- wphttl=129 #Win Phone (for Wi-Fi hotspot)
- #All done.
- #Dosen't change code below this comment.
- sw0=$(sw_vers -productName)
- sw1=$(sw_vers -productVersion)
- sw2=$(sw_vers -buildVersion)
- reset
- echo =========================================================
- echo Yota Mobile Access.sh
- echo =========================================================
- echo
- echo Version : "1.0 dbg"
- echo Supported : "macOS, iOS, Android, Windows Phone, and custom value."
- echo System : "$sw0 $sw1 $sw2"
- echo
- echo Description : "If your provider blocked Wi-Fi or USB hotspot on device, you can try this soliution."
- echo "This script increase TTL value for your device, and Internet provider doesn't understand that connection is going outside the device."
- echo
- echo =======================================================
- echo
- echo "Enable debug mode? [y/n]: \c"
- read DBG
- if [ $DBG = 'y' ]; then
- echo "DBG: dbug — Debug mode is enabled"
- log=~/Desktop/YMA.log
- #workaround "No such file or directory"
- date=$(date) #
- echo "DBG: date — $date" > $log #
- sleep .5
- rm $log #
- #workaround "No such file or directory"
- sleep 1
- echo "DBG: file — Log file created (or refreshed) in ~/Desktop/YMA.log"
- echo "DBG: file — Yota Mobile Access.sh" > $log
- echo "DBG: date — $date" >> $log
- echo "DBG: dbug — $DBG" >> $log
- echo "DBG: mosx — $sw0 $sw1 $sw2" >> $log
- fi
- if [ $DBG != 'y' ]; then
- echo "Debug mode is disabled"
- fi
- echo
- echo =======================================================
- echo
- ttl0=$(sysctl net.inet.ip.ttl | cut -c 18-)
- if [ $ttl0 = '64' ]; then
- echo "Current TTL = 64. This TTL value is default value for macOS."
- if [ $DBG = 'y' ]; then
- echo "DBG: ttl0 – $ttl0" >> $log
- fi
- fi
- if [ $ttl0 = '65' ]; then
- echo "Current TTL = 65. This TTL value is a good choice for iOS and Android."
- if [ $DBG = 'y' ]; then
- echo "DBG: ttl0 – $ttl0" >> $log
- fi
- echo "Do you want continue anyway? [y/n]: \c"
- read anyway
- if [ $anyway = 'y' ]; then
- if [ $DBG = 'y' ]; then
- echo "DBG: anyw – $anyway" >> $log
- fi
- fi
- if [ $anyway = 'n' ]; then
- echo
- echo Aborting...
- if [ $DBG = 'y' ]; then
- echo "DBG: anyw – $anyway" >> $log
- echo "DBG: ttl1 — $ttl0" >> $log
- echo "DBG: exit – aborted" >> $log
- fi
- echo
- sleep 1.5
- echo =========================================================
- echo All done. Have a nice day!
- echo
- echo Always for you, osxpc.ru team.
- echo =========================================================
- echo
- echo "Close this session in 10 seconds..."
- sleep 10
- echo
- exit
- fi
- fi
- if [ $ttl0 = '129' ]; then
- echo "Current TTL = 129. This TTL value is a good choice for Windows Phone."
- if [ $DBG = 'y' ]; then
- echo "DBG: ttl0 – $ttl0" >> $log
- fi
- echo "Do you want continue anyway? [y/n]: \c"
- read anyway
- if [ $anyway = 'y' ]; then
- if [ $DBG = 'y' ]; then
- echo "DBG: anyw – $anyway" >> $log
- fi
- fi
- if [ $anyway = 'n' ]; then
- echo
- echo Aborting...
- if [ $DBG = 'y' ]; then
- echo "DBG: anyw – $anyway" >> $log
- echo "DBG: ttl1 — $ttl0" >> $log
- echo "DBG: exit – aborted" >> $log
- fi
- echo
- sleep 1.5
- echo =========================================================
- echo All done. Have a nice day!
- echo
- echo Always for you, osxpc.ru team.
- echo =========================================================
- echo
- echo "Close this session in 10 seconds..."
- sleep 10
- echo
- exit
- fi
- fi
- if [ $ttl0 != '64' ]; then
- if [ $ttl0 != '65' ]; then
- if [ $ttl0 != '129' ]; then
- if [ $ttl0 -lt 64 ]; then
- if [ $DBG = 'y' ]; then
- echo "DBG: ttl0 – !!! $ttl0 !!!" >> $log
- fi
- echo "!!!"
- echo "Current TTL = $ttl0. This TTL value has nothing to do with anything, but it needs to be increased minimal to 64 (and greater)."
- echo "!!!"
- fi
- if [ $ttl0 -gt 64 ]; then
- echo "Current TTL = $ttl0. This TTL value has nothing to do with anything, but it does not require any changes."
- if [ $DBG = 'y' ]; then
- echo "DBG: ttl0 – $ttl0" >> $log
- fi
- echo "Do you want continue anyway? [y/n]: \c"
- read anyway
- if [ $anyway = 'y' ]; then
- if [ $DBG = 'y' ]; then
- echo "DBG: anyw – $anyway" >> $log
- fi
- fi
- if [ $anyway = 'n' ]; then
- echo
- echo Aborting...
- if [ $DBG = 'y' ]; then
- echo "DBG: anyw – $anyway" >> $log
- echo "DBG: ttl1 — $ttl0" >> $log
- echo "DBG: exit – aborted" >> $log
- fi
- echo
- sleep 1.5
- echo =========================================================
- echo All done. Have a nice day!
- echo
- echo Always for you, osxpc.ru team.
- echo =========================================================
- echo
- echo "Close this session in 10 seconds..."
- sleep 10
- echo
- exit
- fi
- fi
- fi
- fi
- fi
- echo
- echo =======================================================
- echo
- echo "Supported Platforms:"
- echo
- echo "0 — macOS (recovery default value)"
- echo "1 — iOS (for Instant hotspot, Wi-Fi hotspot and USB connection)"
- echo "2 — Android (for Wi-Fi hotspot and USB connection)"
- echo "3 — Win Phone (for Wi-Fi hotspot)"
- echo "4 — Custom TTL (for technical specialists or test)"
- echo "5 — Abort (just aborted executing this script)"
- echo
- echo "Enter number platform: \c"
- read platform
- if [ $DBG = 'y' ]; then
- echo "DBG: plfm – $platform" >> $log
- fi
- if [ $platform = '0' ]; then
- echo Changed platform: macOS
- fi
- if [ $platform = '1' ]; then
- echo Changed platform: iOS
- fi
- if [ $platform = '2' ]; then
- echo Changed platform: Android
- fi
- if [ $platform = '3' ]; then
- echo Changed platform: Windows Phone
- fi
- if [ $platform = '4' ]; then
- echo Changed platform: Custom TTL
- fi
- if [ $platform = '5' ]; then
- echo
- echo Aborting...
- if [ $DBG = 'y' ]; then
- echo "DBG: ttl1 — $ttl0" >> $log
- echo "DBG: exit — aborted" >> $log
- fi
- echo
- sleep 1.5
- echo =========================================================
- echo All done. Have a nice day!
- echo Reconnect your device and get Internet!
- echo
- echo Always for you, osxpc.ru team.
- echo =========================================================
- echo
- echo "Close this session in 10 seconds..."
- sleep 10
- echo
- exit
- fi
- echo
- echo =========================================================
- echo
- if [ $platform = '0' ]; then
- echo "Set TTL value for macOS"
- if [ $DBG = 'y' ]; then
- echo "DBG: exec – sysctl net.inet.ip.ttl=$macttl" >> $log
- sudo sysctl net.inet.ip.ttl=$macttl >> $log
- fi
- sudo sysctl net.inet.ip.ttl=$macttl | cut -c 30-
- ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
- if [ $ttl1 = $macttl ]; then
- echo "Success! Now TTL = $ttl1"
- else
- echo "Error. TTL doesn't changed."
- fi
- fi
- if [ $platform = '1' ]; then
- echo "Set TTL value for iOS"
- if [ $DBG = 'y' ]; then
- echo "DBG: exec – sysctl net.inet.ip.ttl=$macttl" >> $log
- sudo sysctl net.inet.ip.ttl=$iosttl >> $log
- fi
- sudo sysctl net.inet.ip.ttl=$iosttl | cut -c 30-
- ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
- if [ $ttl1 = $iosttl ];
- then
- echo "Success! Now TTL = $ttl1"
- else
- echo "Error. TTL doesn't changed."
- fi
- fi
- if [ $platform = '2' ]; then
- echo "Set TTL value for Android"
- if [ $DBG = 'y' ]; then
- echo "DBG: exec – sysctl net.inet.ip.ttl=$macttl" >> $log
- sudo sysctl net.inet.ip.ttl=$andttl >> $log
- fi
- sudo sysctl net.inet.ip.ttl=$andttl | cut -c 30-
- ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
- if [ $ttl1 = $andttl ];
- then
- echo "Success! Now TTL = $ttl1"
- else
- echo "Error. TTL doesn't changed."
- fi
- fi
- if [ $platform = '3' ]; then
- echo "Set TTL value for Windows Phone"
- if [ $DBG = 'y' ]; then
- echo "DBG: exec – sysctl net.inet.ip.ttl=$macttl" >> $log
- sudo sysctl net.inet.ip.ttl=$wphttl >> $log
- fi
- sudo sysctl net.inet.ip.ttl=$wphttl | cut -c 30-
- ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
- if [ $ttl1 = $wphttl ];
- then
- echo "Success! Now TTL = $ttl1"
- else
- echo "Error. TTL doesn't changed."
- fi
- fi
- if [ $platform = '4' ]; then
- echo "What TTL value need assigning?"
- echo "Set TTL value = \c"
- read customttl
- if [ $DBG = 'y' ]; then
- echo "DBG: exec – sysctl net.inet.ip.ttl=$macttl" >> $log
- sudo sysctl net.inet.ip.ttl=$customttl >> $log
- fi
- sudo sysctl net.inet.ip.ttl=$customttl | cut -c 30-
- ttl1=$(sysctl net.inet.ip.ttl | cut -c 18-)
- if [ $ttl1 = $customttl ];
- then
- echo "Success! Now TTL = $ttl1"
- else
- echo "Error. TTL doesn't changed."
- fi
- fi
- echo
- echo =========================================================
- echo All done. Have a nice day!
- echo Reconnect your device and get Internet!
- if [ $DBG = 'y' ]; then
- echo
- echo "DBG: ttl1 — $ttl1" >> $log
- echo "DBG: exit — end of script" >> $log
- echo "DBG: Do you want open ~/Desktop/YMA.log? [y/n]: \c"
- echo
- read openlog
- if [ $openlog = 'y' ]; then
- open $log
- fi
- fi
- echo Always for you, osxpc.ru team.
- echo =========================================================
- echo
- echo "Close this session in 10 seconds..."
- sleep 10
- echo
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement