[office] copymachine
At the office, we have a scanner attached to a desktop (elisa), published as a
:net device by SANE. Additionally,
a network printer (gutenberg) is attached to the network. This script allows
anyone on the network to combine both as a (basic) copymachine.
#!/bin/sh
colourmode="Gray"
depth=8
resolution=300
printername="samsung"
copies=1
while getopts cd:r:P:n: option
do
case $option in
c) colourmode="Color";;
d) depth=$OPTARG;;
r) resolution=$OPTARG;;
P) printername="$OPTARG";;
n) copies="$OPTARG";;
?) printf "Usage: %s [-c] [-d depth] [-r resolution] [-P printername] [-n copies]\n" $0
exit 2;;
esac
done
/usr/bin/scanimage --mode $colourmode --depth $depth \
--resolution $resolution -x 215 -y 297 \
| /usr/bin/pnmtops -noshowpage -equalpixels -dpi=$resolution \
| /usr/bin/lpr -P $printername -# $copies
Remember it’s statically configured for A4 papersize (215mm x 297mm).