debianmacno-cupsweb
Last change
on this file since fe74c7c was
fe74c7c,
checked in by Jessica B. Hamrick <jhamrick@…>, 14 years ago
|
Added gbr, a queueing script for gutenbach
|
-
Property mode set to
100755
|
File size:
496 bytes
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | # Written by Jessica Hamrick (C) 2010 |
---|
4 | |
---|
5 | use strict; |
---|
6 | use warnings; |
---|
7 | use IPC::Open2; |
---|
8 | |
---|
9 | my $usage = "Usage: gbr QUEUE FILE\n"; |
---|
10 | |
---|
11 | my $q = $ARGV[0]; |
---|
12 | my $file = $ARGV[1]; |
---|
13 | |
---|
14 | if (!$q or !$file) { |
---|
15 | print $usage; |
---|
16 | exit 1 |
---|
17 | } |
---|
18 | |
---|
19 | my $configpath = "$ENV{'HOME'}/.gutenbach/$q"; |
---|
20 | my ($host, $queue); |
---|
21 | |
---|
22 | if (-r $configpath) { |
---|
23 | local $/; |
---|
24 | my $fh; |
---|
25 | open $fh, $configpath; |
---|
26 | eval <$fh>; |
---|
27 | } |
---|
28 | |
---|
29 | my @args = ("lp", "-h$host", "-d$queue", "$file"); |
---|
30 | exec (@args) or die "Couldn't execute lp command"; |
---|
Note: See
TracBrowser
for help on using the repository browser.