unitprint/backend-local = ssh://git@root-kit.ru:17458/UnitPrint/backend-local.git ``` env *** env *** disable ``` ``` sh *** build *** cargo build --release mkdir ../bin cp -l target/release/backend-local ../bin ``` ``` cfg *** run deps *** cups cups-filters foomatic-db hplip ``` ``` sh *** setup *** PRINTER_URI=$(lpinfo -v | awk '/^direct usb:\/\// {print $2; exit}') MODEL=$(python3 -c "import urllib.parse,sys; print(urllib.parse.unquote('$PRINTER_URI'.split('/')[-1].split('?')[0]))") PPD_PATH=$(lpinfo -m | grep -i "$MODEL" | grep -iv 'postscript' | grep -i 'hpcups' | head -n1 | awk '{print $1}') if [[ -z "$PPD_PATH" ]]; then PPD_PATH=$(lpinfo -m | grep -i "$MODEL" | grep -iv 'postscript' | head -n1 | awk '{print $1}') fi echo "URI: $PRINTER_URI" echo "Model: $MODEL" echo "PPD: $PPD_PATH" lpadmin -p Auto_HP_P2015 -E -v "$PRINTER_URI" -m "$PPD_PATH" lpadmin -d Auto_HP_P2015 echo "Default printer set:" lpstat -d lpoptions -p Auto_HP_P2015 -o PageSize=A4 ```