Fixed Speedtest Logic

This commit is contained in:
Riccardo Bicelli 2021-07-07 10:05:25 +02:00
parent 5a36f380fd
commit f1d7ca8e5d

View File

@ -207,13 +207,6 @@ function pfz_speedtest_exec ($ifname, $ipaddr){
$filerun = "/tmp/speedtest-run";
$filecron = "/tmp/speedtest.cron";
if (file_exists($filename)) {
$json_output = json_decode(file_get_contents($filename), true);
if ($json_output==null) @unlink($filename);
return $json_output;
}
if ( (time()-filemtime($filename) > SPEEDTEST_INTERVAL * 3600) || (file_exists($filename)==false) ) {
// file is older than SPEEDTEST_INTERVAL
if ( (time()-filemtime($filerun) > 180 ) ) @unlink($filerun);