mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Add option to notify for security updates only https://github.com/webmin/webmin/issues/2075
This commit is contained in:
@@ -217,7 +217,8 @@ print &ui_table_row($text{'index_email'},
|
||||
# Install or just notify?
|
||||
print &ui_table_row($text{'index_action'},
|
||||
&ui_radio("action", int($config{'sched_action'}),
|
||||
[ [ 0, $text{'index_action0'} ],
|
||||
[ [ -1, $text{'index_action-1'} ],
|
||||
[ 0, $text{'index_action0'} ],
|
||||
[ 1, $text{'index_action1'} ],
|
||||
[ 2, $text{'index_action2'} ] ]));
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@ index_schedd=day
|
||||
index_schedw=week
|
||||
index_email=Email updates report to
|
||||
index_action=Action when update needed
|
||||
index_action0=Just notify
|
||||
index_action-1=Just notify for security updates
|
||||
index_action0=Just notify for any updates
|
||||
index_action1=Install security updates
|
||||
index_action2=Install any updates
|
||||
index_err=Failed to fetch package list
|
||||
|
||||
@@ -12,9 +12,6 @@ if ($ARGV[0] eq "--debug" || $ARGV[0] eq "-debug") {
|
||||
&flush_package_caches();
|
||||
&clear_repository_cache();
|
||||
@todo = &list_possible_updates();
|
||||
foreach $a (@todo) {
|
||||
$a->{'level'} = $a->{'security'} ? 1 : 2;
|
||||
}
|
||||
|
||||
# Install packages that are needed
|
||||
$tellcount = 0;
|
||||
@@ -22,7 +19,8 @@ $tellcount = 0;
|
||||
&start_update_progress([ map { $_->{'name'} } @todo ]);
|
||||
foreach $t (@todo) {
|
||||
next if ($already{$t->{'update'}});
|
||||
if ($t->{'level'} <= $config{'sched_action'}) {
|
||||
if ($config{'sched_action'} == 2 ||
|
||||
$config{'sched_action'} == 1 && $t->{'security'}) {
|
||||
# Can install
|
||||
$body .= "An update to $t->{'name'} from $t->{'oldversion'} to $t->{'version'} is needed.\n";
|
||||
($out, $done) = &capture_function_output(
|
||||
@@ -37,7 +35,9 @@ foreach $t (@todo) {
|
||||
$already{$p}++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
elsif ($config{'sched_action'} == 1 ||
|
||||
$config{'sched_action'} == 0 ||
|
||||
$config{'sched_action'} == -1 && $t->{'security'}) {
|
||||
# Just tell the user about it
|
||||
$body .= "An update to $t->{'name'} from $t->{'oldversion'} to $t->{'version'} is available.\n\n";
|
||||
$tellcount++;
|
||||
|
||||
Reference in New Issue
Block a user