Created
October 5, 2018 08:07
-
-
Save itskenny0/812eaa58fb8a0676d5cdbfb38fb851f7 to your computer and use it in GitHub Desktop.
Find the device node (/dev/usb/lp0) for a connected line printer and symlink it to a known location
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 | |
for i in 0 1 2 3 4 5 6 7 8 9; do | |
if udevadm info -q all -n /dev/usb/lp$i >/dev/null 2>&1; then | |
echo Found lp$i | |
[ -f /opt/cmkbon/printer ] || unlink /opt/cmkbon/printer | |
ln -s /dev/usb/lp$i /opt/cmkbon/printer | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment