blob: 4d6ad2ca273078c428fe114d782e38e789234274 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#!/bin/sh
printer="$1"
queue_dir="$2"
printed_dir=$queue_dir/printed/
mkdir -p $printed_dir
printqueue(){
ls $queue_dir/new/* 2>/dev/null
}
queuedepth=$(printqueue | wc -l)
if [ ! -c "$printer" ] ; then
printf "labelprinter is offline, there are %d jobs in queue\n" $queuedepth >&2
exit 1
fi
for file in $(printqueue); do
echo printing $file
./ql570/ql570 $printer $file
status=$?
if [ $status -ne 0 ] ; then
exit $status
fi
mv $file $printed_dir
done
exit 0
|