Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Check if all navigation bar modules can be loaded
#!/usr/bin/perl
use strict;
use warnings;
use lib qw(/opt/otrs);
use Kernel::System::ObjectManager;
local $Kernel::OM = Kernel::System::ObjectManager->new;
my $MainObject = $Kernel::OM->Get('Kernel::System::Main');
my $ConfigObject = $Kernel::OM->Get('Kernel::Config');
my @Configs = (
'Frontend::NavBarOutputModule',
'Frontend::NotifyModule',
'Frontend::NavBarModule',
"Frontend::NavigationModule",
);
for my $ConfigKey ( @Configs ) {
my $Config = $ConfigObject->Get($ConfigKey);
for my $Module ( keys %{ $Config || {} } ) {
next if $MainObject->Require(
$Config->{$Module}->{Module},
Silent => 1,
);
print "Please check sysconfig option $Module ($ConfigKey)!\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment