tstat - plan9port - [fork] Plan 9 from user space
(HTM) git clone git://src.adamsgaard.dk/plan9port
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit f3435ec58b8e5e2b403ba5040392495ef9727233
(DIR) parent 999a81d3acb226f1dd9678cf56c20a7674bb6801
(HTM) Author: rsc <devnull@localhost>
Date: Sun, 17 Sep 2006 20:49:33 +0000
stat
Diffstat:
A lp/stat/generic | 27 +++++++++++++++++++++++++++
A lp/stat/lpd | 11 +++++++++++
2 files changed, 38 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/lp/stat/generic b/lp/stat/generic
t@@ -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
+}
(DIR) diff --git a/lp/stat/lpd b/lp/stat/lpd
t@@ -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