Ignore:
Timestamp:
Aug 14, 2010, 9:30:39 PM (14 years ago)
Author:
Kyle Brogle <broglek@…>
Branches:
master, debian, mac, no-cups
Children:
618236b, 9dee329
Parents:
55b24d1
git-author:
Kyle Brogle <broglek@…> (08/14/10 21:30:39)
git-committer:
Kyle Brogle <broglek@…> (08/14/10 21:30:39)
Message:

Implemented default queue in client scripts.
Queue argument now optional for gb{r,rm,q}, and also takes form of -q QUEUE
now.

gutenbach-client-config -sset-default QUEUE will set default queue

Updated manpages accordingly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • client/bin/gutenbach-client-config

    r30beeab r7cdd65d  
    1919my $delete = "";
    2020my $host = "";
     21my $default = "";
    2122
    2223GetOptions ('l|list' => \$list,
     24            's|set-default=s' => \$default,
    2325            'a|add=s' => \$add,
    2426            'd|delete=s' => \$delete,
     
    3032    mkdir "$configpath";
    3133}
     34#set given queue to default
     35if($default and !$add and !$delete and !$list) {
     36    unless(-e "$configpath/$default") {
     37        print "Error: queue '$default' doesn't exist yet...you should add it first.\n";
     38        exit 1;
     39    }
     40    if( -e "$configpath/DEFAULT"){
     41        unlink("$configpath/DEFAULT") or die "Couldn't remove config file '$configpath/DEFAULT'";
     42    }
     43    my $symlink_exists = eval { symlink("",""); 1 };
     44    if ($symlink_exists){
     45        symlink("$configpath/$default","$configpath/DEFAULT");
     46        print "Changed default queue to $default.\n";
     47    }
     48    else
     49    {
     50        print "Error creating symlink to $configpath/$default";
     51        exit 1;
     52    }
     53}
     54   
     55       
    3256
    3357# list the existing queues
    34 if ($list and !$add and !$delete) {
     58elsif ($list and !$add and !$delete and !$default) {
    3559    my @queues = glob("$configpath/*") or die "Couldn't find configuration files at '$configpath'";
    3660
Note: See TracChangeset for help on using the changeset viewer.