Skip to content

Commit

Permalink
Show current Upgrade Source even if currently unreachable.
Browse files Browse the repository at this point in the history
Fixes #1626
  • Loading branch information
cpinkham committed Nov 10, 2023
1 parent c18da6d commit 347a811
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion www/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,18 @@ function UpdatePlatforms() {
} else {
$IPs = explode("\n", trim(shell_exec("/sbin/ifconfig -a | grep 'inet ' | awk '{print \$2}'")));
}
$found = 0;
foreach ($remotes as $desc => $host) {
if ((!in_array($host, $IPs)) && (!preg_match('/^169\.254\./', $host))) {
$upgradeSources[$desc] = $host;
if (isset($settings['UpgradeSource']) && ($settings['UpgradeSource'] == $host))
$found = 1;
}
}
$upgradeSources = array("github.com" => "github.com") + $upgradeSources;
if (!$found && isset($settings['UpgradeSource']) && ($settings['UpgradeSource'] != 'github.com'))
$upgradeSources = array($settings['UpgradeSource'] . ' (Unreachable)' => $settings['UpgradeSource'], 'github.com' => 'github.com') + $upgradeSources;
else
$upgradeSources = array("github.com" => "github.com") + $upgradeSources;
?>
<tr><td>FPP Upgrade Source:</td><td><?PrintSettingSelect("Upgrade Source", "UpgradeSource", 0, 0, "github.com", $upgradeSources);?></td></tr>
<?
Expand Down

0 comments on commit 347a811

Please sign in to comment.