Last active
September 5, 2019 16:12
-
-
Save hobbyquaker/63adb691c6e3954295cf3070e21a420d to your computer and use it in GitHub Desktop.
create udev symlink for usb serial tty
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
#!/bin/bash | |
DEV="$1" | |
LINK="$2" | |
INFO=$(udevadm info -a -n $DEV) | |
VENDOR=$(echo "$INFO" | grep '{idVendor}' | head -n1) | |
PRODUCT=$(echo "$INFO" | grep '{idProduct}' | head -n1) | |
SERIAL=$(echo "$INFO" | grep '{serial}' | head -n1) | |
echo "SUBSYSTEM==\"tty\", ${VENDOR}, ${PRODUCT}, ${SERIAL}, SYMLINK+=\"$2\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment