mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
Missed this.
This commit is contained in:
parent
6174642093
commit
2863ba101f
1 changed files with 29 additions and 0 deletions
29
lp/kill/generic
Executable file
29
lp/kill/generic
Executable file
|
@ -0,0 +1,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 ''
|
Loading…
Reference in a new issue