Created
May 8, 2013 17:50
-
-
Save tiomoreno/5542197 to your computer and use it in GitHub Desktop.
Instala regra udev para reconhecimento de aparelhos android no linux
This file contains 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
UDEV_RULE_PATH="/etc/udev/rules.d/51-android.rules" | |
ANDROID_RULE='SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"' | |
instala_regra_udev() { | |
echo $ANDROID_RULE >> $UDEV_RULE_PATH | |
sudo udevadm control --reload-rules | |
echo "Driver instalado com sucesso!" | |
} | |
if [ -f "$UDEV_RULE_PATH" ] | |
then | |
if grep -qs '^'$ANDROID_RULE $UDEV_RULE_PATH | |
then | |
echo "Driver instalado" | |
else | |
instala_regra_udev | |
fi | |
else | |
instala_regra_udev | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment