added github fallback for cty data (dxcc update)

This commit is contained in:
HB9HIL
2025-01-03 19:24:55 +01:00
parent 13792c41c2
commit c35a03b4bd

View File

@@ -206,13 +206,27 @@ class Update extends CI_Controller {
$this->migration->latest();
// Download latest file.
$url = "https://cdn.clublog.org/cty.php?api=608df94896cb9c5421ae748235492b43815610c9";
$url = "https://cdn.clublog.rg/cty.php?api=608df94896cb9c5421ae748235492b43815610c9";
$gz = gzopen($url, 'r');
if ($gz === FALSE) {
$this->update_status("FAILED: Could not download from clublog.org");
log_message('error', 'FAILED: Could not download data from clublog.org');
exit();
$msg = "FAILED: Could not download data from clublog.org. Trying alternative URL.";
$this->update_status($msg);
log_message('error', $msg);
$alt_url = "https://github.com/wavelog/dxcc_data/raw/refs/heads/master/cty.xml.gz";
$gz = gzopen($alt_url, 'r');
if ($gz === FALSE) {
$msg = "FAILED: Could not download dxcc data. Please check your internet connection.";
$this->update_status($msg);
log_message('error', $msg);
exit();
} else {
$msg = "Downloaded data successfully from alternative URL (github).";
$this->update_status($msg);
log_message('debug', $msg);
}
}
$data = "";