changed maxlines to capture 2days worth of data

This commit is contained in:
Darryl Quinn 2015-08-10 18:25:55 -05:00
parent e0c2cbbe5d
commit b9ce490a3c
1 changed files with 4 additions and 4 deletions

View File

@ -3,13 +3,13 @@ BEGIN {push @INC, '/www/cgi-bin'};
use perlfunc; use perlfunc;
my $filename = '/tmp/snrlog'; my $filename = '/tmp/snrlog';
# my $MAXLINES=48960; # 17bytes * 60mins * 24 hours * 2 days my $MAXLINES=2880; # 2days worth
my $MAXLINES=132480; # 23bytes * 60mins * 24 hours * 4 days
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$d = sprintf ("%02d/%02d %02d:%02d:%02d",$mon, $mday,$hour, $min, $sec); $d = sprintf ("%02d/%02d %02d:%02d:%02d",$mon, $mday,$hour, $min, $sec);
($s, $n) = get_wifi_signal(get_interface("wifi")); ($s, $n) = get_wifi_signal(get_interface("wifi"));
$s = $n if $s eq "N/A"; $s = 0 if $s eq "N/A";
$n = 0 if $n eq "N/A";
open(my $fh, '>>', $filename) or die "Could not open file '$filename' $!"; open(my $fh, '>>', $filename) or die "Could not open file '$filename' $!";
print $fh "$d,$s,$n\n"; print $fh "$d,$s,$n\n";