summaryrefslogtreecommitdiffstats
path: root/examples/printer-accounting/hp5-redir
diff options
context:
space:
mode:
authorcvs2svn Import User <samba-bugs@samba.org>1997-10-10 14:46:44 +0000
committercvs2svn Import User <samba-bugs@samba.org>1997-10-10 14:46:44 +0000
commit4480ee713f3ebaaf6852c2e3a5967b30e587f7db (patch)
tree70a8a34fa622fd9adef3dd7f65da299bf6c3e48a /examples/printer-accounting/hp5-redir
parent3590a783338defa4ff1385b2d5bb095c5051ac82 (diff)
downloadsamba-misc-tags/samba.tar.gz
samba-misc-tags/samba.tar.xz
samba-misc-tags/samba.zip
This commit was manufactured by cvs2svn to create tag 'samba'.samba-misc-tags/samba
Diffstat (limited to 'examples/printer-accounting/hp5-redir')
-rw-r--r--examples/printer-accounting/hp5-redir43
1 files changed, 0 insertions, 43 deletions
diff --git a/examples/printer-accounting/hp5-redir b/examples/printer-accounting/hp5-redir
deleted file mode 100644
index 98c2b72edd2..00000000000
--- a/examples/printer-accounting/hp5-redir
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/perl
-#
-# $Source: /data/src/mirror/cvs/samba/examples/printer-accounting/hp5-redir,v $
-# $Id: hp5-redir,v 1.1 1996/07/23 03:30:56 samba-bugs Exp $
-#
-# 0 == stdin == docuement
-# 1 == stdout == printer
-# 2 == stderr == logging
-#
-# With redirection to another valid /etc/printcap entry
-#
-
-umask(002);
-
-# -w132 -l66 -i0 -n pkelly -h master.fcp.oypi.com /var/log/lp-acct
-require "getopts.pl";
-&Getopts("w:l:i:n:h:");
-
-chomp($date = `date '+%Y-%m-%d.%T'`);
-
-($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks)
- = stat(STDIN);
-
-# send to the real printer now.
-open(P, "|lpr -Pmgmt0") || die "Can't print to hp5-real ($!)\n";
-$cnt = 0;
-while (sysread(STDIN, $buf, 10240)) {
- print P $buf;
- # this is ugly, but it gives the approx in pages. We
- # don't print graphics, so ... There must be a better way :)
- $cnt += ($buf =~ /^L/g);
-}
-close(P);
-
-$acct = shift;
-if (open(ACCT, ">>$acct")) {
- print ACCT "$date $opt_n $opt_h $size $cnt\n";
- close(ACCT);
-} else {
- warn "Err: Can't account for it ($!)\n";
- warn "Log: $date $opt_n $opt_h $size $cnt\n";
-}