imported>Meap Die Seite wurde neu angelegt: „Category:Probst-baustoffe <pre> #!/bin/bash # # vorlage job user title num-copies options [ filename ] # # diese Datei steuert die virtuellen Drucker # Sa…“ |
imported>Meap K Meap verschob die Seite Benutzer:Probi/Firma/vorlage nach Benutzer:Jürgen/Firma/vorlage: Seite während der Benutzerkontoumbenennung von „Probi“ in „Jürgen“ automatisch verschoben |
(kein Unterschied)
| |
Version vom 28. Februar 2016, 15:09 Uhr
#!/bin/bash
#
# vorlage job user title num-copies options [ filename ]
#
# diese Datei steuert die virtuellen Drucker
# SaveToTemp SaveToDisk und SaveToVorlage
#
if [ $# -eq 0 ]; then
echo file vorlage \"Unknown\" \"Template File\"
exit 0
fi
if [ "$#" -lt "5" ]; then
echo "ERROR: Number of arguments ($#) is wrong" 1>&2
exit 1
fi
if [ "$#" -gt "6" ]; then
echo "ERROR: Number of arguments ($#) is wrong" 1>&2
exit 1
fi
#
# globals
#
echo "INFO: cmd is $DEVICE_URI" 1>&2
PFAD=${DEVICE_URI#vorlage:}
test -z "$PFAD" && PFAD=/home/daten/vorlagen/drucker
TITLE=$3
test -z "$TITLE" && TITLE=unknown
FILE="$PFAD/$TITLE.eps"
DIR=`dirname "$FILE"`
echo "INFO: File is $FILE" 1>&2
test ! -x "$DIR" && mkdir -p -m 2775 "$DIR" 2>&1 | sed s,^,'ERROR: ',1 >&2
test ! -x "$DIR" && echo "ERROR: creating directory failed: $DIR" 1>&2 && exit -1
test -r "$FILE" && chmod a+w "$FILE"
if [ $# -eq 6 ]; then
ps2epsi $6 $FILE | sed s,^,'ERROR: ',1 >&2
else
tmpfile=/tmp/ps2eps.$$.ps
/usr/bin/pstops 1:0 /dev/stdin $tmpfile
test ! -r $tmpfile && echo >&2 "ERROR: no tmpfile found: $tmpfile" || /usr/bin/ps2epsi $tmpfile $FILE | sed s,^,'ERROR: ',1 >&2
rm -f $tmpfile
fi
chmod a+r,a-w "$FILE"
echo "INFO: Ready to print ..." 1>&2
exit 0