From 0ca16d61a774a83703643eaced3792405e21eb78 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Wed, 27 Jun 2012 20:15:13 -0400 Subject: [PATCH] summarize: check more locations to discover QP dir --- log/summarize.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/log/summarize.pl b/log/summarize.pl index 04784cc..b506d82 100755 --- a/log/summarize.pl +++ b/log/summarize.pl @@ -3,6 +3,7 @@ use strict; use warnings; +use Cwd; use Data::Dumper; use File::Tail; @@ -276,16 +277,20 @@ sub show_symbol { sub get_qp_dir { foreach my $user ( qw/ qpsmtpd smtpd / ) { - my ($homedir) = (getpwnam( $user ))[7] or next; if ( -d "$homedir/plugins" ) { return "$homedir"; }; - if ( -d "$homedir/smtpd/plugins" ) { - return "$homedir/smtpd"; + foreach my $s ( qw/ smtpd qpsmtpd qpsmtpd-dev / ) { + if ( -d "$homedir/smtpd/plugins" ) { + return "$homedir/smtpd"; + }; }; }; + if ( -d "./plugins" ) { + return Cwd::getcwd(); + }; }; sub populate_plugins_from_registry {