#!/bin/sh . /etc/ltsp_functions SERVER=`get_cfg SERVER none` PRINTER_LDP=`get_cfg PRINTER_LDP none` PRINTER_LDP_USER=`get_cfg PRINTER_LDP_USER none` PRINTER_LDP_LIMIT=`get_cfg PRINTER_LDP_LIMIT none` if [ "$SERVER" == "none" ]; then echo "No printing proxy server defined, cannot print" | gtk_popup exit 1 fi if [ "$PRINTER_LDP" == "" -o "$PRINTER_LDP" == "none" ]; then exit 1 fi if [ "$PRINTER_LDP_USER" == "none" ]; then exit 1 # TODO: Hae tässä OIKEAN käyttäjän tunnus fi if [ "$PRINTER_LDP_LIMIT" != "none" ]; then cat - >$TEMP/printjob PAGES=`grep -c "%%Page:" $TEMP/printjob` if [ $PAGES -le $PRINTER_LDP_LIMIT ]; then cat $TEMP/printjob | rlpr --no-bind --user=$PRINTER_LDP_USER --no-burst --tmpdir=$TEMP --printer=$PRINTER_LDP rm -f $TEMP/printjob exit 0 fi rm -f $TEMP/printjob echo "Your print job has $PAGES pages which exceeds maximum number ($PRINTER_LDP_LIMIT). Job was deleted." | gtk_popup exit 1 fi cat - | rlpr --no-bind --user=$PRINTER_LDP_USER --no-burst --tmpdir=$TEMP --printer=$PRINTER_LDP -X$SERVER