mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Log automatic package updates
This commit is contained in:
@@ -103,6 +103,7 @@ sched_yes=Scheduled checking for updates is now active.
|
||||
sched_no=Scheduled checking for updates has been disabled.
|
||||
|
||||
log_update=Installed $1 updated packages
|
||||
log_sched=Background installed $1 updated packages
|
||||
log_sched=Enabled scheduled updates
|
||||
log_unsched=Disabled scheduled updates
|
||||
log_refresh=Refreshed available packages
|
||||
|
||||
@@ -18,6 +18,9 @@ elsif ($type eq 'repo') {
|
||||
elsif ($action eq 'update') {
|
||||
return &text('log_update', $object);
|
||||
}
|
||||
elsif ($action eq 'sched') {
|
||||
return &text('log_sched', $object);
|
||||
}
|
||||
elsif ($action eq 'sched') {
|
||||
return $text{$object ? 'log_sched' : 'log_unsched'};
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ if ($ARGV[0] eq "--debug" || $ARGV[0] eq "-debug") {
|
||||
$tellcount = 0;
|
||||
%already = ( );
|
||||
&start_update_progress([ map { $_->{'name'} } @todo ]);
|
||||
$icount = 0;
|
||||
foreach $t (@todo) {
|
||||
next if ($already{$t->{'update'}});
|
||||
my $umsg = $t->{'security'} ? "security update" : "update";
|
||||
@@ -24,6 +25,7 @@ foreach $t (@todo) {
|
||||
$config{'sched_action'} == 1 && $t->{'security'}) {
|
||||
# Can install
|
||||
$body .= "An $umsg to $t->{'name'} from $t->{'oldversion'} to $t->{'version'} is needed.\n";
|
||||
$icount++;
|
||||
($out, $done) = &capture_function_output(
|
||||
\&package_install, $t->{'update'});
|
||||
if (@$done) {
|
||||
@@ -70,3 +72,7 @@ if ($config{'sched_email'} && $body) {
|
||||
}
|
||||
}
|
||||
|
||||
# Log the update, if anything was installed
|
||||
if ($icount) {
|
||||
&webmin_log("sched", "packages", $icount);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user