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