Handle hostnames with upper-case letters
[webmin.git] / webmin / change_status.cgi
1 #!/usr/local/bin/perl
2 # Save status collection options
3
4 require './webmin-lib.pl';
5 &ReadParse();
6 &foreign_require("system-status");
7 &error_setup($text{'status_err'});
8
9 # Save collection interval
10 if ($in{'interval_def'}) {
11         $system_status::config{'collect_interval'} = 'none';
12         }
13 else {
14         $in{'interval'} =~ /^\d+$/ && $in{'interval'} > 0 &&
15            $in{'interval'} <= 60 || &error($text{'status_einterval'});
16         $system_status::config{'collect_interval'} = $in{'interval'};
17         }
18
19 # Save collection options
20 $system_status::config{'collect_pkgs'} = $in{'pkgs'};
21 $system_status::config{'collect_notemp'} = !$in{'temp'};
22
23 &lock_file($system_status::module_config_file);
24 &save_module_config(\%system_status::config, 'system-status');
25 &unlock_file($system_status::module_config_file);
26 &system_status::setup_collectinfo_job();
27 if ($in{'interval_def'}) {
28         &unlink_file($system_status::collected_info_file);
29         }
30 else {
31         &system_status::scheduled_collect_system_info();
32         }
33
34 &webmin_log("status");
35 &redirect("");
36