Skip to content

Commit

Permalink
Merge pull request #88 from ipitio/master
Browse files Browse the repository at this point in the history
count days from now and secure list
  • Loading branch information
arevindh authored Feb 22, 2024
2 parents fd766b9 + 2baa694 commit 4ed34ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api_speedtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
$setupVars = parse_ini_file('/etc/pihole/setupVars.conf');

$cmdLog = '[[ -f /tmp/pimod.log ]] && cat /tmp/pimod.log || { [[ -f /var/log/pihole/mod.log ]] && cat /var/log/pihole/mod.log || echo ""; }';
$cmdServers = 'speedtest -h | grep -q official && sudo speedtest -L || speedtest --list';
$cmdServers = 'speedtest -h | grep -q official && sudo speedtest -L || speedtest --secure --list';
$cmdRun = '[[ -f /tmp/speedtest.log ]] && cat /tmp/speedtest.log || { [[ -f /etc/pihole/speedtest.log ]] && cat /etc/pihole/speedtest.log || echo ""; }';
$cmdServersCurl = "curl 'https://c.speedtest.net/speedtest-servers-static.php' --compressed -H 'Upgrade-Insecure-Requests: 1' -H 'DNT: 1' -H 'Sec-GPC: 1'";
$cmdServersJSON = "curl 'https://www.speedtest.net/api/js/servers' --compressed -H 'Upgrade-Insecure-Requests: 1' -H 'DNT: 1' -H 'Sec-GPC: 1'";
Expand Down
3 changes: 1 addition & 2 deletions scripts/pi-hole/js/speedtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ function formatDate(itemdate, results) {
}

const first = moment(results.at(0).start_time, "YYYY-MM-DD HH:mm:ssZ");
const last = moment(results.at(-1).start_time, "YYYY-MM-DD HH:mm:ssZ");
if (last.diff(first, "hours") > 24) {
if (moment.utc().diff(first, "hours") > 24) {
output = "Do HH:mm";
}

Expand Down

0 comments on commit 4ed34ae

Please sign in to comment.