Don't try to run apachectl if path is not defined http://virtualmin.com/node/31403

This commit is contained in:
Jamie Cameron
2013-12-03 15:58:01 -08:00
parent 850f5673bc
commit 30dd5eb41e

View File

@@ -1753,13 +1753,16 @@ foreach $l (&find_directive_struct("LoadModule", $conf)) {
undef(@get_config_cache); # Cache is no longer valid
# Add dynamically loaded modules
&open_execute_command(APACHE, "$config{'apachectl_path'} -M 2>/dev/null", 1);
while(<APACHE>) {
if (/(\S+)_module/ && -r "$module_root_directory/mod_${1}.pl") {
push(@rv, "mod_${1}");
if ($config{'apachectl_path'}) {
&open_execute_command(APACHE,
"$config{'apachectl_path'} -M 2>/dev/null", 1);
while(<APACHE>) {
if (/(\S+)_module/ && -r "$module_root_directory/mod_${1}.pl") {
push(@rv, "mod_${1}");
}
}
close(APACHE);
}
close(APACHE);
return &unique(@rv);
}