From 7a7859fdf12e8c71fb60ae500ecc025cc40bf979 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sun, 9 Dec 2018 21:15:13 -0800 Subject: perl: find db.conf when run from another path Signed-off-by: Robin H. Johnson --- perl/sentry.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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}; -- cgit v1.2.3-65-gdbad