861 B
861 B
Password-Printer
printer.sh
This script prints out a random passoword on a thermal printer upon button press.
Device
We use a Card Start 8010 thermal printer. With the USB adaptor, you can simply send text via echo to the /dev/usb/lp1 device. It is printed if the line is full (24 characters) or when a "\r" sequence is sent.
Commands
Wanted Output:
+---------------------+
| Dein Passwort: |
| 0123456789 |
+---------------------+
Test Output:
echo -e "\r\r+---------------------+\r| Dein Passwort: |\r| 0123456789 |\r+---------------------+\r\r\r" > /dev/usb/lp1
Final command:
#!/bin/sh
echo "\r\r+----------------------+| Dein Passwort lautet || " > /dev/usb/lp1
pwgen -N1 10 > /dev/usb/lp1
echo " |+----------------------+\r\r" > /dev/usb/lp1