File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,19 @@ set -euo pipefail
44
55. oks-lib.sh
66
7+ # NixOS generates `printers.conf` for us but we can't know the printers SN in
8+ # advance of the first ceremony where it's used. As a work-around we query cups
9+ # for the serial number for the attached printer and then swap it in
10+ # `printers.conf` with the place holder `SN_GOES_HERE`
11+ PRINTER_SN_REGEX=' ^direct[[:space:]]\+usb:\/\/Brother\/QL-600?serial=\(.*\)$'
12+ PRINTER_SN=$( lpinfo -v | sed -n " s/$PRINTER_SN_REGEX /\1/p" )
13+ info " Label printer with SN: $PRINTER_SN found"
14+
15+ systemctl stop cups.service
16+ sed -i " s/SN_GOES_HERE/$PRINTER_SN /g" /etc/cups/printers.conf
17+ systemctl start cups.service
18+ info " Label printer with SN: $PRINTER_SN configured"
19+
720# assume system has just booted & OS CD is still in the drive
821wait_for_cd
922hash-cd
You can’t perform that action at this time.
0 commit comments