Handle hostnames with upper-case letters
[webmin.git] / webalizer / webalizer.pl
1 #!/usr/local/bin/perl
2 # webalizer.pl
3 # Generate a report on schedule
4
5 $no_acl_check++;
6 require './webalizer-lib.pl';
7 $lconf = &get_log_config($ARGV[0]);
8 $lconf || die "Logfile $ARGV[0] config file does not exist";
9
10 open(NULL, ">/dev/null");
11 $ok = &generate_report($ARGV[0], NULL, 0);
12 close(NULL);
13
14 if ($ok && $lconf->{'clear'}) {
15         # Truncate or delete the files for this report
16         foreach $f (&all_log_files($ARGV[0])) {
17                 next if (!-r $f);
18                 if ($f eq $ARGV[0]) {
19                         # Just truncate the main log file
20                         truncate($f, 0);
21                         }
22                 else {
23                         # Delete any extra compressed files
24                         unlink($f);
25                         }
26                 }
27         }
28