Fixed Speedtest Logic

This commit is contained in:
Riccardo Bicelli 2021-07-07 10:20:09 +02:00
parent f1d7ca8e5d
commit 5546a6c2b9
1 changed files with 3 additions and 3 deletions

View File

@ -205,7 +205,6 @@ function pfz_speedtest_exec ($ifname, $ipaddr){
$filename = "/tmp/speedtest-$ifname";
$filerun = "/tmp/speedtest-run";
$filecron = "/tmp/speedtest.cron";
if ( (time()-filemtime($filename) > SPEEDTEST_INTERVAL * 3600) || (file_exists($filename)==false) ) {
// file is older than SPEEDTEST_INTERVAL
@ -213,12 +212,13 @@ function pfz_speedtest_exec ($ifname, $ipaddr){
if (file_exists($filerun)==false) {
touch($filerun);
$st_command = "nohup /usr/local/bin/speedtest --source $ipaddr --json > $filename && rm $filerun &";
$st_command = "/usr/local/bin/speedtest --source $ipaddr --json > $filename";
exec ($st_command);
@unlik($filerun);
}
}
return false;
return true;
}