mirror of
https://github.com/webmin/webmin.git
synced 2025-08-16 14:51:18 +00:00
44 lines
938 B
Perl
Executable File
44 lines
938 B
Perl
Executable File
#!/usr/local/bin/perl
|
|
# run-postinstalls.pl
|
|
# Run all the postinstall.pl scripts in module and theme directories
|
|
|
|
$no_acl_check++;
|
|
do './web-lib.pl';
|
|
&init_config();
|
|
&foreign_require("webmin", "webmin-lib.pl");
|
|
@themes = &webmin::list_themes();
|
|
|
|
if (@ARGV > 0) {
|
|
# Running for specified modules
|
|
foreach $a (@ARGV) {
|
|
local %minfo = &get_module_info($a);
|
|
if (!%minfo) {
|
|
# Try for a theme
|
|
($tinfo) = grep { $_->{'dir'} eq $a } @themes;
|
|
if ($tinfo) {
|
|
push(@mods, $tinfo);
|
|
}
|
|
}
|
|
else {
|
|
push(@mods, \%minfo);
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
# Running on all modules and themes
|
|
@mods = ( &get_all_module_infos(), @themes );
|
|
}
|
|
|
|
foreach $m (@mods) {
|
|
$mdir = &module_root_directory($m->{'dir'});
|
|
if (&check_os_support($m) &&
|
|
-r "$mdir/postinstall.pl") {
|
|
# Call this module's postinstall function
|
|
eval {
|
|
&foreign_require($m->{'dir'}, "postinstall.pl");
|
|
&foreign_call($m->{'dir'}, "module_install");
|
|
};
|
|
}
|
|
}
|
|
|