Skip to content

Commit

Permalink
fix getting version (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipitio authored Mar 1, 2024
1 parent f69d459 commit e693f17
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
20 changes: 10 additions & 10 deletions api_speedtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
6 changes: 4 additions & 2 deletions scripts/pi-hole/php/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<?php if ($web_update) { ?> &middot; <a class="lookatme" lookatme-text="Update available!" href="<?php echo $webUrl.'/latest'; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?>
</li>
<li>
<strong>Speedtest Mod</strong>
<strong>Speedtest</strong>
<?php echo $speedtestVersionStr; ?>
<?php if ($speedtest_update) { ?> &middot; <a class="lookatme" lookatme-text="Update available!" href="<?php echo $speedtestUrl.'/latest'; ?>" rel="noopener" target="_blank">Update available!</a><?php } ?>
</li>
Expand All @@ -98,7 +98,9 @@
<?php if ($docker_update) { ?>
To install updates, <a href="https://github.com/pi-hole/docker-pi-hole#upgrading-persistence-and-customizations" rel="noopener" target="_blank">replace this old container with a fresh upgraded image</a>.
<?php } elseif ($core_update || $web_update || $FTL_update) { ?>
To install updates, run <code><a href="https://docs.pi-hole.net/main/update/" rel="noopener" target="_blank">pihole -up</a></code>.
To install updates, uninstall Speedtest Mod, run <code><a href="https://docs.pi-hole.net/main/update/" rel="noopener" target="_blank">pihole -up</a></code>, and reinstall Speedtest Mod. The Reinstall button in [ Settings > Speedtest ] can do this for you!
<?php } elseif ($speedtest_update) { ?>
To install updates, reinstall Speedtest Mod. The Reinstall button in [ Settings > Speedtest ] can do this for you!
<?php } ?>
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions scripts/pi-hole/php/update_checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit e693f17

Please sign in to comment.