Skip to content

Commit 74b1a52

Browse files
committed
Update irods_setup.pl
add logic to connect to a remote db on the initial setup
1 parent 4c3addc commit 74b1a52

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

iRODS/scripts/perl/irods_setup.pl

+9-1
Original file line numberDiff line numberDiff line change
@@ -2975,7 +2975,15 @@ ()
29752975
chomp $PSQL;
29762976
$PSQL=$PSQL . "/psql";
29772977
# print "$PSQL -U $DATABASE_ADMIN_NAME -p $DATABASE_PORT -l $DB_NAME";
2978-
my ($status,$output) = run( "$PSQL -U $DATABASE_ADMIN_NAME -p $DATABASE_PORT -l $DB_NAME" );
2978+
my ($status,$output);
2979+
if ($DATABASE_HOST eq "localhost")
2980+
{
2981+
($status,$output) = run( "$PSQL -U $DATABASE_ADMIN_NAME -p $DATABASE_PORT -l $DB_NAME" );
2982+
}
2983+
else
2984+
{
2985+
($status,$output) = run( "$PSQL -U $DATABASE_ADMIN_NAME -p $DATABASE_PORT -l $DB_NAME -h $DATABASE_HOST" );
2986+
}
29792987
if ( $output =~ /List of databases/i )
29802988
{
29812989
printStatus( " [$DB_NAME] Found.\n");

0 commit comments

Comments
 (0)