X-Git-Url: http://git.equinoxoli.org/?p=migration-tools.git;a=blobdiff_plain;f=text%2Fcsv2sql;h=37a136d686237e59285fe84588c969c3ee57546c;hp=39ce2d2298543349c4a253f01fc11d052c0cd8ba;hb=e2850e245100f5ec46bb4dfa950864e7a44c6731;hpb=b0f046246177b7157d1354dc08c1ae89a5f5ec24 diff --git a/text/csv2sql b/text/csv2sql index 39ce2d2..37a136d 100755 --- a/text/csv2sql +++ b/text/csv2sql @@ -15,11 +15,11 @@ my $csv_config; sub init { our %config; - do '/openils/conf/offline-config.pl'; if ($PGHOST and $PGPORT and $PGUSER and $PGDATABASE) { - $db = connect_db($PGDATABASE,$PGUSER,undef,$PGHOST) or die $DBI::errstr; + $dbh = connect_db($PGDATABASE,$PGUSER,undef,$PGHOST) or die $DBI::errstr; } else { + do '/openils/conf/offline-config.pl'; $dbh = DBI->connect( $config{dsn}, $config{usr}, $config{pw} ) or die $DBI::errstr; }