Skip to content

Instantly share code, notes, and snippets.

View IsHacker003's full-sized avatar

IsHacker IsHacker003

View GitHub Profile
#!/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"