aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2018-12-09 21:15:13 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2018-12-09 21:15:13 -0800
commit7a7859fdf12e8c71fb60ae500ecc025cc40bf979 (patch)
tree83ebd8003cb1d0b17197a10cb63a69ab95e6761d
parentAvoid HTTP downgrades (diff)
downloadbouncer-7a7859fdf12e8c71fb60ae500ecc025cc40bf979.tar.gz
bouncer-7a7859fdf12e8c71fb60ae500ecc025cc40bf979.tar.bz2
bouncer-7a7859fdf12e8c71fb60ae500ecc025cc40bf979.zip
perl: find db.conf when run from another path
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xperl/sentry.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/perl/sentry.pl b/perl/sentry.pl
index bc4788c..3da9291 100755
--- a/perl/sentry.pl
+++ b/perl/sentry.pl
@@ -9,6 +9,7 @@ use Data::Dumper;
use LWP;
use LWP::UserAgent;
use Config::Tiny;
+use File::Basename;
$ua = LWP::UserAgent->new;
$ua->timeout(4);
@@ -17,7 +18,8 @@ $ua->agent("Gentoo Mirror Monitor/1.0");
my $DEBUG = 1;
my %products = ();
my %oss = ();
-my $Config = Config::Tiny->read( 'db.conf' );
+my $dirname = dirname(__FILE__);
+my $Config = Config::Tiny->read( $dirname . '/db.conf' );
# Some db credentials
my $host = $Config->{database}->{host};