Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get PRODID without the need for user intervention #27

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions scripts/2_script_manual.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,14 @@ echo " "

echo "Install tty hotplug rule..."
opkg update && opkg install usbutils;
cat << "EOF" > /etc/hotplug.d/usb/22-tty-symlink


PRODID=$(grep -h "$( lsusb | grep Host | awk '{ gsub(":0*", "/", $6); print $6 }' )" /sys/bus/usb/devices/*/uevent | uniq | awk '{ gsub("PRODUCT=", "", $1); print $1}')

echo "PRODID=\"$PRODID\"" > /etc/hotplug.d/usb/22-tty-symlink

cat << "EOF" >> /etc/hotplug.d/usb/22-tty-symlink
# Description: Action executed on boot (bind) and with the system on the fly
PRODID="1a86/7523/264" #change here according to "PRODUCT=" from grep command
SYMLINK="ttyPrinter" #you can change this to whatever you want just don't use spaces. Use this inside printer.cfg as serial port path
if [ "${ACTION}" = "bind" ] ; then
case "${PRODUCT}" in
Expand Down