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

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
5use strict;
6use warnings;
7use IPC::Open2;
8
9my $usage = "Usage: gbr QUEUE FILE\n";
10
11my $q = $ARGV[0];
12my $file = $ARGV[1];
13
14if (!$q or !$file) {
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 = ("lp", "-h$host", "-d$queue", "$file");
30exec (@args) or die "Couldn't execute lp command";
Note: See TracBrowser for help on using the repository browser.