- Timestamp:
- Jul 5, 2010, 5:48:11 PM (14 years ago)
- Branches:
- master, debian, mac, no-cups, web
- Children:
- b58aada
- Parents:
- a81397c
- git-author:
- Jessica B. Hamrick <jhamrick@…> (07/05/10 17:48:11)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (07/05/10 17:48:11)
- Location:
- client/bin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
client/bin/gbr
rc5a98db r38388ac 6 6 use warnings; 7 7 8 my $usage = "Usage: gbr QUEUE FILE \n";8 my $usage = "Usage: gbr QUEUE FILES\n"; 9 9 10 10 my $q = $ARGV[0]; 11 my $file = $ARGV[1];11 my @files = @ARGV[1 .. $#ARGV]; 12 12 13 if (!$q or ! $file) {13 if (!$q or !@files) { 14 14 print $usage; 15 15 exit 1 … … 33 33 $ENV{CUPS_SERVER}="$host"; 34 34 35 if ($file =~ m|http://www\.youtube\.com/watch\?v=|) { 36 open(LP, "|-", "lp", "-d$queue"); 37 print LP "$file"; 38 close LP; 35 foreach my $file(@files) { 36 if ($file =~ m|http://www\.youtube\.com/watch\?v=|) { 37 open(LP, "|-", "lp", "-d$queue") or die "Couldn't execute lp command"; 38 print LP "$file"; 39 close LP; 40 } 41 else { 42 my $pid = open(LP, "-|"); 43 if (not $pid) { 44 my @args = ("lp", "-d$queue", "$file"); 45 exec(@args) or die "Couldn't execute lp command"; 46 } 47 } 48 49 print "Sent job '$file'\n"; 39 50 } 40 else {41 my @args = ("lp", "-d$queue", "$file");42 exec (@args) or die "Couldn't execute lp command";43 } -
client/bin/gbr.1
rc5a98db r38388ac 4 4 .SH SYNOPSIS 5 5 .B gbr 6 \fIQUEUE\fR \fIFILE \fR6 \fIQUEUE\fR \fIFILES\fR 7 7 .SH DESCRIPTION 8 Prints a file to a Gutenbach queue, given the queue name and the path 9 to the file. The path may also be a URL to a 8 Prints files to a Gutenbach queue, given the queue name and the path 9 to the files. gbr correctly handles pathname expansion, so (for 10 example), if you wish to play all .mp3 files in a directory, the 11 command `gbr $queue *.mp3` will send each .mp3 as a separate job. The 12 path may also be a URL to a 10 13 .B YouTube 11 14 video (e.g. http://www.youtube.com/watch?v=foo). The Gutenbach queue
Note: See TracChangeset
for help on using the changeset viewer.