IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 30, 2008, 12:44:12 PM (18 years ago)
Author:
jhoblitt
Message:

add --host option to neb-initdb
add --host option to neb-addvol

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/bin/neb-addvol

    r16315 r18386  
    33# Copyright (C) 2005-2008  Joshua Hoblitt
    44#
    5 # $Id: neb-addvol,v 1.8 2008-02-05 23:14:22 eugene Exp $
     5# $Id: neb-addvol,v 1.9 2008-06-30 22:44:12 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, $volume, $uri);
     21my ($db, $dbhost, $dbuser, $dbpass, $volume, $uri);
    2222
    2323$db     = $ENV{'NEB_DB'} unless $db;
     24$dbhost = $ENV{'NEB_DBHOST'} || 'localhost';
    2425$dbuser = $ENV{'NEB_USER'} unless $dbuser;
    2526$dbpass = $ENV{'NEB_PASS'} unless $dbpass;
     
    2728GetOptions(
    2829    'db=s'      => \$db,
     30    'host=s'     => \$dbhost,
    2931    'user=s'    => \$dbuser,
    3032    'pass=s'    => \$dbpass,
     
    3840
    3941my $dbh = DBI->connect(
    40     "DBI:mysql:database=$db:host=localhost",
     42    "DBI:mysql:database=$db:host=$dbhost",
    4143    $dbuser,
    4244    $dbpass,
     
    129131Equivalent to --db|-d
    130132
     133=item * C<NEB_HOST>
     134
     135Equivalent to --host
     136
    131137=item * C<NEB_USER>
    132138
Note: See TracChangeset for help on using the changeset viewer.