source: gutenbach-client/debian/bin/gbrm @ 2a2f76c

debianmacno-cupsweb
Last change on this file since 2a2f76c was 2a2f76c, checked in by Jessica B. Hamrick <jhamrick@…>, 14 years ago

Added gbrm, a job removal script for gutenbach

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