This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Detect tethering interface name on the phone (rndis0 or usb0) | |
| intf_cmd=$(adb shell "su -c 'if [ -e \"/sys/class/net/usb0\" ]; then echo \"Tethering interface: usb0\"; elif [ -e \"/sys/class/net/rndis0\" ]; then echo \"Tethering interface: rndis0\"; else echo "Unable to find tethering interface."; fi'") | |
| if [ "$intf_cmd" == "Tethering interface: usb0" ] | |
| then | |
| echo "$intf_cmd" | |
| intf="usb0" |