source: gutenbach-client/debian/bin/gbr @ f0a76cc

debianmacno-cupsweb
Last change on this file since f0a76cc 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: 480 bytes
Line 
1#!/usr/bin/perl
2
3# Written by Jessica Hamrick (C) 2010
4
5use strict;
6use warnings;
7
8my $usage = "Usage: gbr QUEUE FILE\n";
9
10my $q = $ARGV[0];
11my $file = $ARGV[1];
12
13if (!$q or !$file) {
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 = ("lp", "-h$host", "-d$queue", "$file");
29exec (@args) or die "Couldn't execute lp command";
Note: See TracBrowser for help on using the repository browser.