mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Fix not to run check_reboot_required on initial load
This commit is contained in:
@@ -677,10 +677,13 @@ return $mode eq 'updates' || $mode eq 'security' ?
|
||||
&list_possible_updates($nocache) : &list_available($nocache);
|
||||
}
|
||||
|
||||
# check_reboot_required(after-flag)
|
||||
# check_reboot_required([no-collect])
|
||||
# Returns 1 if the package system thinks a reboot is needed
|
||||
# If the no-collect flag is set, then check won't happen
|
||||
sub check_reboot_required
|
||||
{
|
||||
my ($no_collect) = @_;
|
||||
return 0 if ($no_collect);
|
||||
if ($gconfig{'os_type'} eq 'debian-linux') {
|
||||
return -e "/var/run/reboot-required" ? 1 : 0;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ else {
|
||||
}
|
||||
else {
|
||||
# Check if a reboot was required before
|
||||
$reboot_before = &check_reboot_required(0);
|
||||
$reboot_before = &check_reboot_required();
|
||||
|
||||
# Do it
|
||||
$msg = $in{'mode'} eq 'new' ? 'update_pkg2' : 'update_pkg';
|
||||
@@ -165,7 +165,7 @@ else {
|
||||
}
|
||||
|
||||
# Check if a reboot is required now
|
||||
if (!$reboot_before && &check_reboot_required(1) &&
|
||||
if (!$reboot_before && &check_reboot_required() &&
|
||||
&foreign_check("init")) {
|
||||
print &ui_form_start(
|
||||
"@{[&get_webprefix()]}/init/reboot.cgi");
|
||||
|
||||
Reference in New Issue
Block a user