Project

General

Profile

« Previous | Next » 

Revision 414053da

Added by Jim Pingle about 15 years ago

Fix NanoBSD automatic update checks.

View differences:

usr/local/www/system_firmware_auto.php
124 124
<?php
125 125

  
126 126
update_status(gettext("Downloading current version information") . "...");
127
download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version");
127
$nanosize = "";
128
if ($g['platform'] == "nanobsd") {
129
	$nanosize = "-nanobsd-" . strtolower(trim(file_get_contents("/etc/nanosize.txt")));
130
}
131

  
132
download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version");
128 133
$latest_version = str_replace("\n", "", @file_get_contents("/tmp/{$g['product_name']}_version"));
129 134
if(!$latest_version) {
130 135
	update_output_window(gettext("Unable to check for updates."));
......
143 148
		if (pfs_version_compare($current_installed_buildtime, $current_installed_version, $latest_version) == -1) {
144 149
			update_status(gettext("Downloading updates") . "...");
145 150
			conf_mount_rw();
146
			$status = download_file_with_progress_bar("{$updater_url}/latest.tgz", "{$g['upload_path']}/latest.tgz", "read_body_firmware");	
147
			$status = download_file_with_progress_bar("{$updater_url}/latest.tgz.sha256", "{$g['upload_path']}/latest.tgz.sha256");
151

  
152
			$status = download_file_with_progress_bar("{$updater_url}/latest{$nanosize}.tgz", "{$g['upload_path']}/latest.tgz", "read_body_firmware");	
153
			$status = download_file_with_progress_bar("{$updater_url}/latest{$nanosize}.tgz.sha256", "{$g['upload_path']}/latest.tgz.sha256");
148 154
			conf_mount_ro();
149 155
			update_output_window("{$g['product_name']} " . gettext("download complete."));
150 156
		} else {
usr/local/www/system_firmware_check.php
120 120
	$updater_url = $g['update_url'];
121 121
$needs_system_upgrade = false;
122 122
$static_text .= gettext("Downloading new version information...");
123
download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version");
123

  
124
$nanosize = "";
125
if ($g['platform'] == "nanobsd") {
126
	$nanosize = "-nanobsd-" . strtolower(trim(file_get_contents("/etc/nanosize.txt")));
127
}
128

  
129
download_file_with_progress_bar("{$updater_url}/version{$nanosize}", "/tmp/{$g['product_name']}_version");
124 130
$remote_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version"));
125 131
$static_text .= gettext("done") . "\\n";
126 132
if (!$remote_version) {
......
155 161
echo "\n<script>$('invokeupgrade').style.visibility = 'visible';</script>";
156 162
$txt  = gettext("A new version is now available") . "\\n\\n";
157 163
$txt .= gettext("Current version") .": ". $current_installed_version . "\\n";
164
if ($g['platform'] == "nanobsd") {
165
	$txt .= "  " . gettext("NanoBSD Size") . " : " . trim(file_get_contents("/etc/nanosize.txt")) . "\\n";
166
}
158 167
$txt .= "       " . gettext("Built On") .": ".  $current_installed_buildtime . "\\n";
159 168
$txt .= "    " . gettext("New version") .": ".  $remote_version . "\\n\\n";
160 169
$txt .= "  " . gettext("Update source") .": ".  $updater_url . "\\n";

Also available in: Unified diff