1 |
commit: 7a7859fdf12e8c71fb60ae500ecc025cc40bf979 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Dec 10 05:15:13 2018 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 10 05:15:13 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/bouncer.git/commit/?id=7a7859fd |
7 |
|
8 |
perl: find db.conf when run from another path |
9 |
|
10 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
11 |
|
12 |
perl/sentry.pl | 4 +++- |
13 |
1 file changed, 3 insertions(+), 1 deletion(-) |
14 |
|
15 |
diff --git a/perl/sentry.pl b/perl/sentry.pl |
16 |
index bc4788c..3da9291 100755 |
17 |
--- a/perl/sentry.pl |
18 |
+++ b/perl/sentry.pl |
19 |
@@ -9,6 +9,7 @@ use Data::Dumper; |
20 |
use LWP; |
21 |
use LWP::UserAgent; |
22 |
use Config::Tiny; |
23 |
+use File::Basename; |
24 |
|
25 |
$ua = LWP::UserAgent->new; |
26 |
$ua->timeout(4); |
27 |
@@ -17,7 +18,8 @@ $ua->agent("Gentoo Mirror Monitor/1.0"); |
28 |
my $DEBUG = 1; |
29 |
my %products = (); |
30 |
my %oss = (); |
31 |
-my $Config = Config::Tiny->read( 'db.conf' ); |
32 |
+my $dirname = dirname(__FILE__); |
33 |
+my $Config = Config::Tiny->read( $dirname . '/db.conf' ); |
34 |
|
35 |
# Some db credentials |
36 |
my $host = $Config->{database}->{host}; |