blob: f6c472b93497da33c0e92f253ef6f7a880bd33dd (
plain)
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
|
#!/usr/local/plan9/bin/rc
if (! ~ $DEBUG '') flag x +
cd $LPSPOOL
if (~ $#* 0) KILLARGS=`{sed 1q};
if not KILLARGS=$*;
if (test -d $LPDEST) {
for (i in $KILLARGS) {
for (j in `{lpsub sched $SCHED $LPDEST}) {
if (test -r $LPDEST/$j^id) {
STATLINE=`{cat $LPDEST/$j^id}
if (~ $STATLINE(1)^$STATLINE(3) $i)
if (rm $LPDEST/$j $LPDEST/$j^id >/dev/null >[1=2])
echo $i removed from $LPDEST queue on $THIS_HOST
}
}
}
}
if (! ~ $THIS_HOST $DEST_HOST) {
@{echo -d$LPDEST -k;echo $KILLARGS;sleep 7} | lpsend.rc $DEST_HOST
}; if not {
if (! ~ $KILLCMD '') {
for (i in $KILLARGS) {
$KILLCMD $i;
}
}
}
exit ''
|