Now it's not needed to have also reports enabled in 'traffacct.pm' to generate daily traffic counters

This commit is contained in:
Jordi Sanfeliu 2016-05-20 10:15:12 +02:00
parent 832abfc664
commit 7cb0fadfdd
1 changed files with 7 additions and 5 deletions

View File

@ -683,7 +683,7 @@ while(1) {
}
# TRAFFACCT graph daily reports
if(lc($config{traffacct}->{enabled}) eq "y" && lc($config{traffacct}->{reports}->{enabled}) eq "y") {
if(lc($config{traffacct}->{enabled}) eq "y"
my $d = "traffacct";
undef($d) if(!grep {trim($_) eq $d} (@{$config{debug}}));
@ -697,10 +697,12 @@ while(1) {
}
# send reports every first day of a month
if($mday == 1) {
eval { traffacct::traffacct_sendreports(\%config, $d); };
if($@) {
logger("traffacct::traffacct_sendreports(): $@");
if(lc($config{traffacct}->{reports}->{enabled}) eq "y") {
if($mday == 1) {
eval { traffacct::traffacct_sendreports(\%config, $d); };
if($@) {
logger("traffacct::traffacct_sendreports(): $@");
}
}
}
}