summarize: check more locations to discover QP dir

This commit is contained in:
Matt Simerson 2012-06-27 20:15:13 -04:00
parent 8fd04a2621
commit 0ca16d61a7

View File

@ -3,6 +3,7 @@
use strict; use strict;
use warnings; use warnings;
use Cwd;
use Data::Dumper; use Data::Dumper;
use File::Tail; use File::Tail;
@ -276,16 +277,20 @@ sub show_symbol {
sub get_qp_dir { sub get_qp_dir {
foreach my $user ( qw/ qpsmtpd smtpd / ) { foreach my $user ( qw/ qpsmtpd smtpd / ) {
my ($homedir) = (getpwnam( $user ))[7] or next; my ($homedir) = (getpwnam( $user ))[7] or next;
if ( -d "$homedir/plugins" ) { if ( -d "$homedir/plugins" ) {
return "$homedir"; return "$homedir";
}; };
foreach my $s ( qw/ smtpd qpsmtpd qpsmtpd-dev / ) {
if ( -d "$homedir/smtpd/plugins" ) { if ( -d "$homedir/smtpd/plugins" ) {
return "$homedir/smtpd"; return "$homedir/smtpd";
}; };
}; };
};
if ( -d "./plugins" ) {
return Cwd::getcwd();
};
}; };
sub populate_plugins_from_registry { sub populate_plugins_from_registry {