diff --git a/application/controllers/Update.php b/application/controllers/Update.php index b734c7edc..0a2225b48 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -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 = "";