From e693f1704599ed95fbe30c33ddd71c2849d2aeb0 Mon Sep 17 00:00:00 2001 From: ipitio <21136719+ipitio@users.noreply.github.com> Date: Fri, 1 Mar 2024 02:20:08 -0500 Subject: [PATCH] fix getting version (#91) --- api_speedtest.php | 20 ++++++++++---------- scripts/pi-hole/php/footer.php | 6 ++++-- scripts/pi-hole/php/update_checker.php | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/api_speedtest.php b/api_speedtest.php index 6c905d4b4..efacd731c 100644 --- a/api_speedtest.php +++ b/api_speedtest.php @@ -341,15 +341,15 @@ function getStatusCmd() function whichSpeedtest() { - if (!file_exists('/usr/bin/speedtest')) { - return 'official'; - } - $version = speedtestExecute('/usr/bin/speedtest --version')['data']; - if (strpos($version, 'LibreSpeed') !== false) { - return 'LibreSpeed'; - } elseif (strpos($version, 'Python') !== false) { - return 'sivel\'s'; - } else { - return 'official'; + if (file_exists('/usr/bin/speedtest')) { + $version = speedtestExecute('/usr/bin/speedtest --version')['data']; + if (strpos($version, 'LibreSpeed') !== false) { + return 'LibreSpeed'; + } + if (strpos($version, 'Python') !== false) { + return 'sivel\'s'; + } } + + return 'official'; } diff --git a/scripts/pi-hole/php/footer.php b/scripts/pi-hole/php/footer.php index 3b03e7dd5..9cb747875 100644 --- a/scripts/pi-hole/php/footer.php +++ b/scripts/pi-hole/php/footer.php @@ -88,7 +88,7 @@ · Update available!
  • - Speedtest Mod + Speedtest · Update available!
  • @@ -98,7 +98,9 @@ To install updates, replace this old container with a fresh upgraded image. - To install updates, run pihole -up. + To install updates, uninstall Speedtest Mod, run pihole -up, and reinstall Speedtest Mod. The Reinstall button in [ Settings > Speedtest ] can do this for you! + + To install updates, reinstall Speedtest Mod. The Reinstall button in [ Settings > Speedtest ] can do this for you!

    diff --git a/scripts/pi-hole/php/update_checker.php b/scripts/pi-hole/php/update_checker.php index e6bf0240a..e2be46944 100644 --- a/scripts/pi-hole/php/update_checker.php +++ b/scripts/pi-hole/php/update_checker.php @@ -116,8 +116,8 @@ function checkUpdate($currentVersion, $latestVersion) } // URLs for the links -$coreUrl = 'https://github.com/pi-hole/pi-hole/releases'; -$webUrl = 'https://github.com/pi-hole/AdminLTE/releases'; +$coreUrl = 'https://github.com/arevindh/pi-hole/releases'; +$webUrl = 'https://github.com/arevindh/AdminLTE/releases'; $ftlUrl = 'https://github.com/pi-hole/FTL/releases'; $dockerUrl = 'https://github.com/pi-hole/docker-pi-hole/releases'; $speedtestUrl = 'https://github.com/arevindh/pihole-speedtest/releases';