Make default uptime time random

This commit is contained in:
Jamie Cameron
2008-03-21 03:21:09 +00:00
parent f8111b1ada
commit 4823291faf
3 changed files with 10 additions and 2 deletions

View File

@@ -74,3 +74,4 @@ The nice level (CPU priority) of all cron and other background jobs run by Webmi
---- Changes since 1.400 ----
Use the gzip -d command to extract Webmin modules, if gunzip is missing (such as on Windows).
Users with too many failed logins can be locked until the administrator unlocks them.
The default scheduled update time is now randomly selected.

View File

@@ -2,6 +2,5 @@ update=0
upmissing=0
upshow=1
updays=1
uphour=3
cron_mode=0
osdn=1

View File

@@ -1,9 +1,17 @@
require 'webmin-lib.pl';
# Update cache of which module's underlying servers are installed
sub module_install
{
# Update cache of which module's underlying servers are installed
&build_installed_modules();
# Pick a random update time
if (!defined($config{'uphour'})) {
&seed_random();
$config{'uphour'} = int(rand()*24);
$config{'upmins'} = int(rand()*60);
&save_module_config();
}
}