Handle hostnames with upper-case letters
[webmin.git] / bacula-backup / fixaddr.cgi
1 #!/usr/local/bin/perl
2 # Update the host in bconsole.conf to match this system
3
4 require './bacula-backup-lib.pl';
5
6 &lock_file($bconsole_conf_file);
7 $conconf = &get_bconsole_config();
8 $condir = &find("Director", $conconf);
9 $addr = &get_system_hostname();
10 if (!&to_ipaddress($addr) && !&to_ip6address($addr)) {
11         $addr = "localhost";
12         }
13 &save_directive($conconf, $condir, "Address", $addr, 1);
14 &flush_file_lines();
15 &unlock_file($bconsole_conf_file);
16
17 &webmin_log("fixaddr");
18 &redirect("");
19