source: gutenbach-client/debian/bin/gbrm @ 78eb866c

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
5use strict;
6use warnings;
7
8my $usage = "Usage: gbq QUEUE ID\n";
9
10my $q = $ARGV[0];
11my $id = $ARGV[1];
12
13if (!$q or !$id) {
14    print $usage;
15    exit 1
16}
17
18my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
19my ($host, $queue);
20
21if (-r $configpath) {
22    local $/;
23    my $fh;
24    open $fh, $configpath;
25    eval <$fh>;
26}
27
28my @args;
29
30if ($id eq "all") {
31    @args = ("cancel", "-a", "-h$host", "$queue");
32}
33else {
34    @args = ("cancel", "-h$host", "$id", "$queue");
35}
36exec (@args) or die "Couldn't execute cancel command";
Note: See TracBrowser for help on using the repository browser.