From f3435ec58b8e5e2b403ba5040392495ef9727233 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 17 Sep 2006 20:49:33 +0000 Subject: stat --- lp/stat/generic | 27 +++++++++++++++++++++++++++ lp/stat/lpd | 11 +++++++++++ 2 files changed, 38 insertions(+) create mode 100755 lp/stat/generic create mode 100755 lp/stat/lpd (limited to 'lp') diff --git a/lp/stat/generic b/lp/stat/generic new file mode 100755 index 00000000..67cfaf1a --- /dev/null +++ b/lp/stat/generic @@ -0,0 +1,27 @@ +#!/usr/local/plan9/bin/rc +if (! ~ $DEBUG '') flag x + + +if (~ $THIS_HOST $DEST_HOST) { + if (test -f $LPLIB/log/$LPDEST^.st) { + echo status: + tail -3 $LPLIB/log/$LPDEST^.st + } + cd $LPSPOOL + if (test -d $LPDEST) { + once='' + for (i in `{bind -b $LPLIB/sched /bin;$SCHED $LPDEST}) { + if (~ $once '') { + echo + echo queue on $THIS_HOST: + echo 'job user try size' + once=1 + } + STATLINE=`{cat $LPDEST/$i^id} + LSLINE=`{ls -l $LPDEST/$i} + echo $STATLINE(1)^$STATLINE(3)' '$STATLINE(2)' '$STATLINE(4)' '$LSLINE(6) + } + } +} +if not { + { echo -d$LPDEST -q; sleep 5 } | lpsend $DEST_HOST +} diff --git a/lp/stat/lpd b/lp/stat/lpd new file mode 100755 index 00000000..3bea23e1 --- /dev/null +++ b/lp/stat/lpd @@ -0,0 +1,11 @@ +#!/usr/local/plan9/bin/rc + +if (! ~ $DEBUG '') flag x + + +echo transmission log: +if (test -r $LPLIB/log/$LPDEST^.st) { + tail -3 $LPLIB/log/$LPDEST^.st + echo +} +echo printer queue: +lpdsend -q -d$OUTDEV $DEST_HOST -- cgit v1.2.3