From d9694ef28a55ddb5c901f6e2c34397af6d3b38ba Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Fri, 27 Sep 2013 15:45:53 +0200 Subject: Initial --- printerd | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 printerd (limited to 'printerd') diff --git a/printerd b/printerd new file mode 100755 index 0000000..ef93722 --- /dev/null +++ b/printerd @@ -0,0 +1,26 @@ +#! /bin/bash + +# This script runs a daemon that listens on a port for printjobs and pipes +# incoming data into UNIX lpd, which starts a helper program when a print- +# job is incoming. + +USER="$1" +BUSYBOX="busybox" +IP="0.0.0.0" +PORT="515" +SPOOLDIR="/var/spool" +SPOOLQUEUE="STANDARD" +GUIBINARY="printerGUI" + +# Create the directory for the queue +mkdir -p "$SPOOLDIR/$SPOOLQUEUE" + +# Change the owner of the directory such that lpd +# is able to write to it +chown $USER:$USER "$SPOOLDIR/$SPOOLQUEUE" + +# Start the lpdaemon listening on the given port +exec "$BUSYBOX" tcpsvd -Eu "$USER:$USER" "$IP" "$PORT" \ + "$BUSYBOX" lpd "$SPOOLDIR" \ + "$GUIBINARY" + -- cgit v1.2.3-55-g7522