diff --git a/ipasserelle-stats.spec b/ipasserelle-stats.spec index dae81df..e4b2a49 100644 --- a/ipasserelle-stats.spec +++ b/ipasserelle-stats.spec @@ -1,5 +1,5 @@ %define version 0.0.1 -%define release 1.beta3 +%define release 1.beta6 %define name ipasserelle-stats diff --git a/root/etc/e-smith/templates/etc/cron.hourly/awstats/10All b/root/etc/e-smith/templates/etc/cron.hourly/awstats/10All index a006551..50b74fb 100644 --- a/root/etc/e-smith/templates/etc/cron.hourly/awstats/10All +++ b/root/etc/e-smith/templates/etc/cron.hourly/awstats/10All @@ -1,14 +1,14 @@ { use esmith::DomainsDB; my $d = esmith::DomainsDB->open_ro or die "Couldn't open DomainsDB\n"; -my $year = `date +%Y`; +my $lang = $awstats{'Language'} || 'fr'; +$OUT .= 'YEAR=$(date +%Y)'."\n"; foreach my $dom ($d->domains){ my $stats = $dom->prop('Stats') || 'disabled'; next if ($stats ne 'enabled'); my $name = $dom->key; - my $lang = $awstats{'Language'} || 'fr'; - mkdir "/home/e-smith/files/stats/$name/$year/" if (!-d "/home/e-smith/files/stats/$name/$year/"); - $OUT .= "/usr/share/awstats/tools/awstats_buildstaticpages.pl -config=$name -update -lang=$lang -dir=/home/e-smith/files/stats/$name/$year/\n"; + $OUT .= 'mkdir -p /home/e-smith/files/stats/'."$name".'/$YEAR/'."\n"; + $OUT .= "/usr/share/awstats/tools/awstats_buildstaticpages.pl -config=$name -update -lang=$lang -dir=/home/e-smith/files/stats/$name/\$YEAR/\n\n"; } }