rendered paste body#!/usr/bin/perl
@array = `cat domains`;
chomp @array;
$j = '0';
%hash = ();
foreach $dom (@array) {
$dom =~ s/^\s+//;
$dom =~ s/\s+$//;
print <<EOF;
/usr/local/www/cgi-bin/awstats.pl -update -config=$dom -configdir=/etc/awstats
EOF
system("cp /etc/awstats/awstats.model.com.conf /etc/awstats/awstats.$dom.conf");
system("sed s/model.com/$dom/g /etc/awstats/awstats.$dom.conf > /etc/awstats/awstats.$dom.conf.new");
system("mv /etc/awstats/awstats.$dom.conf.new /etc/awstats/awstats.$dom.conf");
}