Skip to content

Instantly share code, notes, and snippets.

@dmix
Created March 3, 2015 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmix/964abd753be07177bff2 to your computer and use it in GitHub Desktop.
Save dmix/964abd753be07177bff2 to your computer and use it in GitHub Desktop.
Tether to android device on linux (automatically finds enp* card name and connects to it via dhcpcd)
#!/bin/bash
# Find card name starting with enp and extract the string from the list
card=`ifconfig -a | ag enp | sed -e 's/.*\([^ ]*enp[^ ]*\).*/\1/g' | sed -e 's/://'`
# Start tethering with card
sudo dhcpcd $card
echo "Tethering to $card connected via USB, you sexy bitch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment