Skip to content

Instantly share code, notes, and snippets.

@teknoraver
Created August 21, 2015 10:36
Show Gist options
  • Save teknoraver/6a5f8a9fd89253e5bcb9 to your computer and use it in GitHub Desktop.
Save teknoraver/6a5f8a9fd89253e5bcb9 to your computer and use it in GitHub Desktop.
#!/bin/sh
rulefile=/etc/udev/rules.d/51-android.rules
url=http://developer.android.com/tools/device.html
rule='/<td><code>....<\/code><\/td>/{print "SUBSYSTEM==\"usb\", ATTR{idVendor}==\""$5"\", MODE=\"0660\", GROUP=\"plugdev\""}'
curl -s $url | awk -F'<|>' "$rule" >$rulefile
chmod 755 $rulefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment