From 30e287c3bec805e7d17eadc3cadf140f1da35a9c Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Thu, 15 May 2014 16:01:28 +0300 Subject: [PATCH] Make tools connect to $ENV{GRUNTMASTER_DSN} if it exists --- gruntmaster-contest | 3 ++- gruntmaster-job | 3 ++- gruntmaster-problem | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gruntmaster-contest b/gruntmaster-contest index ff121cd..856faae 100755 --- a/gruntmaster-contest +++ b/gruntmaster-contest @@ -9,7 +9,8 @@ use Date::Parse qw/str2time/; ################################################## -my $db = Gruntmaster::Data->connect('dbi:Pg:'); +my $dsn = $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:'; +my $db = Gruntmaster::Data->connect($dsn); sub cmd_help{ exec perldoc => $0 diff --git a/gruntmaster-job b/gruntmaster-job index 126e1d0..06e3fe1 100755 --- a/gruntmaster-job +++ b/gruntmaster-job @@ -8,7 +8,8 @@ use POSIX qw/strftime/; ################################################## -my $db = Gruntmaster::Data->connect('dbi:Pg:'); +my $dsn = $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:'; +my $db = Gruntmaster::Data->connect($dsn); sub cmd_help{ exec perldoc => $0 diff --git a/gruntmaster-problem b/gruntmaster-problem index afcb1be..b942897 100755 --- a/gruntmaster-problem +++ b/gruntmaster-problem @@ -11,7 +11,8 @@ use Getopt::Long qw/:config require_order/; ################################################## -my $db = Gruntmaster::Data->connect('dbi:Pg:'); +my $dsn = $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:'; +my $db = Gruntmaster::Data->connect($dsn); sub cmd_help{ exec perldoc => $0 -- 2.39.2