forked from simoncozens/kirin
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcronjobchecker.pl
28 lines (26 loc) · 926 Bytes
/
cronjobchecker.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
do 'kirin.pl';
my $style = shift;
my %needs = (
webhosting => [ qw/ create delete add_feature remove_feature / ],
dns => [ qw/ update_server / ],
database => [ qw/ create drop / ],
domain => [ qw/ add_hosting / ],
mail_redirect => [ qw/ update /],
pop => [ qw/ delete update create /],
secondary_dns => [ qw/ setup /],
sslserver => [ qw/ configure_server deconfigure_server /],
);
for my $plugin (Kirin->plugins) {
my $ok = 1;
next unless $needs{$plugin->name};
print $plugin->name.": ";
my $package = Kirin->cronjobpackagefor($style, $plugin->name);
$package->require;
if ($@ =~ /an't locate/) { print "$package is missing!\n"; next}
if ($@) { print "$package is unhappy: $@\n\n"; next }
for (@{$needs{$plugin->name}}) { unless ($package->can($_)) {
print "$package can't $_"; $ok =0;
print "\n";
} }
if ($ok) { print "All OK\n" }
}