#!/usr/bin/perl # # (c) sh@isecure.cz 2007 # use strict; use constant CONFDIR => "/etc/awstats/"; use constant AWSBIN => "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl "; use constant ARGS => "-update -config="; ############################################################################ opendir(DIRHANDLE, CONFDIR) || die "Cannot opendir ".CONFDIR.": $!"; my $name = ''; foreach $name (sort readdir(DIRHANDLE)) { if($name =~ /^awstats\./) { ############################################# if($name =~ /^awstats\.(.*)\.conf$/) { print "--------------------------------------------\nfound file -> generating stats: $name - $1\n"; system(AWSBIN.ARGS.$1); } ############################################# } } closedir(DIRHANDLE);