-cache_time=1
+cache_time=6
--- /dev/null
+# install_check.pl
+
+do 'package-updates-lib.pl';
+
+# is_installed(mode)
+# For mode 1, returns 2 if the server is installed and configured for use by
+# Webmin, 1 if installed but not configured, or 0 otherwise.
+# For mode 0, returns 1 if installed, 0 if not
+sub is_installed
+{
+return 0 if (!&foreign_installed("software"));
+return $software::update_system ? $_[0]+1 : 0;
+}
+
desc=Software Package Updates
longdesc=Displays available package updates from YUM, APT or other update systems
category=system
-depends=software cron mailboxes 1.420
+depends=software cron mailboxes
os_support=redhat-linux debian-linux mandrake-linux/10.2-* solaris
# Functions for checking for updates to packages from YUM, APT or some other
# update system.
-#
-# XXX cron job to collect .. actually use webmin module collector
-# XXX re-check after package update
-# XXX show on system information page?
BEGIN { push(@INC, ".."); };
eval "use WebminCore;";
}
# Refresh collected package info
- # XXX call webmin
+ if (&foreign_checked("system-status")) {
+ &foreign_require("system-status");
+ &system_status::refresh_possible_packages(\@got));
+ }
&webmin_log("update", "packages", scalar(@got),
{ 'got' => \@got });
--- /dev/null
+---- Changes since 1.490 ----
+First version of this module, for collecting system information using a background Cron job.
--- /dev/null
+#!/usr/local/bin/perl
+# Command-line script to enable status collection
+
+$no_acl_check++;
+require 'system-status-lib.pl';
+$ARGV[0] eq 'none' || $ARGV[0] =~ /^[1-9][0-9]*$/ && $ARGV[0] <= 60 ||
+ die "usage: enable-collection.pl none|<mins>";
+
+$config{'collect_interval'} = $ARGV[0];
+&save_module_config();
+&setup_collectinfo_job();
--- /dev/null
+
+require 'system-status-lib.pl';
+
+sub module_install
+{
+# Create wrapper for system status setup script
+if (&foreign_check("cron")) {
+ &foreign_require("cron");
+ &cron::create_wrapper("$module_config_directory/enable-collection.pl",
+ $module_name, "enable-collection.pl");
+ }
+}
+
# Functions for collecting general system info
#
-# XXX Use on main page of blue theme
-# XXX Show package updates on blue theme main page
# XXX Collect from Cloudmin
# XXX Cloudmin should enable background collection
-# XXX Check new Webmin version and module updates too?
+# XXX Cloudmin should install using YUM
BEGIN { push(@INC, ".."); };
eval "use WebminCore;";
}
# Available package updates
-if (&foreign_check("package-updates") && $config{'collect_pkgs'}) {
+if (&foreign_installed("package-updates") && $config{'collect_pkgs'}) {
&foreign_require("package-updates");
my @poss = &package_updates::list_possible_updates(2, 1);
$info->{'poss'} = \@poss;
&close_tempfile(INFO);
}
-# refresh_startstop_status()
-# Refresh regularly collected info on status of services
-sub refresh_startstop_status
-{
-my $info = &get_collected_info();
-$info->{'startstop'} = [ &get_startstop_links() ];
-&save_collected_info($info);
-}
-
# refresh_possible_packages(&newpackages)
# Refresh regularly collected info on available packages
sub refresh_possible_packages
my ($pkgs) = @_;
my %pkgs = map { $_, 1 } @$pkgs;
my $info = &get_collected_info();
-if ($info->{'poss'} && &foreign_check("package-updates")) {
+if ($info->{'poss'} && &foreign_installed("package-updates")) {
&foreign_require("package-updates");
my @poss = &package_updates::list_possible_updates(2);
$info->{'poss'} = \@poss;