#!/bin/bash # This script cleans up the mess after switching off the printer # during a print job. Note that printing from the commandline goes # like this: # # lpr -PDJ610C document.pdf # # To see which printers are installed, do: # # lpstat -p # Cancel all jobs JOBS=`lpstat -o | awk '{print $1}'` for id in $JOBS; do echo cancelling $id cancel $id done # Restart CUPS + manually kill drivers stop cupsys su lp -c "killall -9 parallel" su lp -c "killall -9 DJ610C" start cupsys