"Fossies" - the Fresh Open Source Software Archive

Member "Demo/Linux/LinuxPrinter.sh" (9 Feb 2009, 901 Bytes) of package /linux/privat/old/YAFPC-src-23.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 #####################################################
    3 # Sample script to be given to lprn via /etc/printcap
    4 #####################################################
    5 
    6 # Edit the following varables to your settings:
    7 
    8 DOMAIN="localhost"
    9 PROFILE="/usr/local/yafpc/MakeDemoLinux.fpc"
   10 LOGFILE="/var/spool/lpd/yafpc.log"
   11 YAFPC="/usr/local/yafpc/YAFPC-2x.jar"
   12 
   13 # Edit these lines only when you know, what you are doing!
   14 USER="`echo $1 | sed -e 's/-A//' | awk -F@ '{ print $1 }'`"
   15 ADDRESS=$USER@$DOMAIN
   16 RANDM=$RANDOM
   17 PSFILE="/tmp/$USER-$RANDM.ps"
   18 PDFFILE="/tmp/$USER-$RANDM.pdf"
   19 PDF=`which ps2pdf`
   20 JAVA=`which java`
   21 
   22 echo ----------------- >> $LOGFILE
   23 date >> $LOGFILE
   24 echo $USER >> $LOGFILE
   25 echo $PROFILE >>$LOGFILE
   26 echo $PDFFILE >>$LOGFILE
   27 
   28 cat > $PSFILE
   29 
   30 $PDF -dPDFSETTINGS=/prepress $PSFILE $PDFFILE
   31 $JAVA -jar $YAFPC -i $PDFFILE -p $PROFILE -m $ADDRESS 2>> $LOGFILE
   32 
   33 rm -f $PSFILE
   34 rm -f $PDFFILE