Changeset b58aada for client/bin/gbrm
- Timestamp:
- Jul 5, 2010, 8:01:47 PM (14 years ago)
- Branches:
- master, debian, mac, no-cups, web
- Children:
- d768767
- Parents:
- 38388ac
- git-author:
- Jessica B. Hamrick <jhamrick@…> (07/05/10 20:01:47)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (07/05/10 20:01:47)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
client/bin/gbrm
ra81397c rb58aada 34 34 } 35 35 36 my @args; 36 my $cups = Net::CUPS->new(); 37 $cups->setServer("$host"); 38 my $printer = $cups->getDestination("$queue"); 39 my @jobs = $printer->getJobs(0, 0); 37 40 38 41 if ($id eq "all") { 39 @args = ("cancel", "-a", "$queue"); 42 foreach $id(@jobs) { 43 $printer->cancelJob($id); 44 } 40 45 } 41 46 elsif ($id eq "current") { 42 my $cups = Net::CUPS->new(); 43 $cups->setServer("$host"); 44 my $printer = $cups->getDestination("$queue"); 45 my @jobs = $printer->getJobs(0, 0); 46 my $id = $jobs[0]; 47 @args = ("cancel", "$id", "$queue"); 47 $id = $jobs[0]; 48 $printer->cancelJob($id); 48 49 } 49 50 else { 50 @args = ("cancel", "$id", "$queue");51 $printer->cancelJob($id); 51 52 } 52 $ENV{CUPS_SERVER}="$host";53 exec (@args) or die "Couldn't execute cancel command";
Note: See TracChangeset
for help on using the changeset viewer.