IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18349


Ignore:
Timestamp:
Jun 27, 2008, 1:29:42 PM (18 years ago)
Author:
jhoblitt
Message:

add --host option to neb-admin

Location:
trunk/Nebulous-Server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/Changes

    r18231 r18349  
    22
    330.13
     4    - add --host option to neb-admin
    45    - add --host option to nebdiskd
    56    - decalare default SQL character set
  • trunk/Nebulous-Server/bin/neb-admin

    r17817 r18349  
    33# Copyright (C) 2005-2008  Joshua Hoblitt
    44#
    5 # $Id: neb-admin,v 1.3 2008-05-27 23:26:15 jhoblitt Exp $
     5# $Id: neb-admin,v 1.4 2008-06-27 23:29:42 jhoblitt Exp $
    66
    77use strict;
     
    99
    1010use vars qw( $VERSION );
    11 $VERSION = '0.01';
     11$VERSION = '0.02';
    1212
    1313use DBI;
     
    1919use Pod::Usage qw( pod2usage );
    2020
    21 my ($db, $dbuser, $dbpass, $pending, $limit);
    22 
    23 $db     = $ENV{'NEB_DB'} unless $db;
    24 $dbuser = $ENV{'NEB_USER'} unless $dbuser;
    25 $dbpass = $ENV{'NEB_PASS'} unless $dbpass;
     21my ($db, $dbhost, $dbuser, $dbpass, $pending, $limit);
     22
     23$db     = $ENV{'NEB_DB'};
     24$dbhost = $ENV{'NEB_DBHOST'} || 'localhost';
     25$dbuser = $ENV{'NEB_USER'};
     26$dbpass = $ENV{'NEB_PASS'};
    2627
    2728GetOptions(
    28     'db=s'                  => \$db,
    29     'user=s'                => \$dbuser,
    30     'pass=s'                => \$dbpass,
    31     'pendingreplicate|p'    => \$pending,
     29    'db|d=s'                => \$db,
     30    'host=s'                => \$dbhost,
     31    'user|u=s'              => \$dbuser,
     32    'pass|p=s'              => \$dbpass,
     33    'pendingreplicate|r'    => \$pending,
    3234    'limit|l=i'             => \$limit,
    3335) || pod2usage( 2 );
     
    4648
    4749my $dbh = DBI->connect(
    48     "DBI:mysql:database=$db:host=localhost",
     50    "DBI:mysql:database=$db:host=$dbhost",
    4951    $dbuser,
    5052    $dbpass,
     
    6971$query->finish;
    7072   
     73exit unless scalar @rows;
     74
    7175print "replciate MULTI\n\n";
    7276
     
    156160=head1 SYNOPSIS
    157161
    158     neb-admin [--db <database>] [--user <username>] [--pass <password>]
    159         [--pendingreplicate] [--limit <n>]
     162    neb-admin [--host <db host>] [--db <db name>] [--user <db username>]
     163        [--pass <db password>] [--pendingreplicate] [--limit <n>]
    160164
    161165=head1 DESCRIPTION
     
    165169=over 4
    166170
    167 =item * --pendingreplicate|-p
     171=item * --pendingreplicate|-r
    168172
    169173Print out a list of nebulous keys that need additional replications created.
     
    176180Optional.  Defaults to 5.  --limit 0 is treated as asking for the default
    177181value.
     182
     183=item * --host <database host>
     184
     185Name of host on which the database resides.
     186
     187Optional.  Defaults to C<localhost>.
    178188
    179189=item * --db|-d <database>
     
    208218
    209219Equivalent to --db|-d
     220
     221=item * C<NEB_HOST>
     222
     223Equivalent to --host
    210224
    211225=item * C<NEB_USER>
Note: See TracChangeset for help on using the changeset viewer.