summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-04-18 02:05:01 +0000
committerColin Smith <colin@pfsense.org>2005-04-18 02:05:01 +0000
commit96ea6c029b113f45329ef129dca39d9687d19198 (patch)
tree22db70a72b3242b877e1638f4ef0064050be111e /usr/local
parent0a5aabe633cec875dc317f79a157f8d50e30fd45 (diff)
downloadpfsense-96ea6c029b113f45329ef129dca39d9687d19198.zip
pfsense-96ea6c029b113f45329ef129dca39d9687d19198.tar.gz
* Use loops for handling both version checking and actual diff application.
* Terminate the update process if an md5 mismatch occurs.
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/system_firmware_auto.php28
1 files changed, 8 insertions, 20 deletions
diff --git a/usr/local/www/system_firmware_auto.php b/usr/local/www/system_firmware_auto.php
index e44d077..649b7fc 100755
--- a/usr/local/www/system_firmware_auto.php
+++ b/usr/local/www/system_firmware_auto.php
@@ -170,12 +170,11 @@ if($use_old_checkversion == false) {
// if(isset($versions[3])) $static_text = $versions[4] . '\n'; // If we have additional data (a CHANGELOG etc) to display, do so.
} else {
update_status("No updates required.");
- } else {
- update_status("No updates required.");
}
+
foreach($needupdate as $toupdate) {
if($toupdate == true) {
- $static_text .= "Downloading {$upgrades[$i]} updates... ";
+ $static_text .= "Installing {$upgrades[$i]} updates... ";
$s = 0;
foreach($versions[$i] as $aver) {
$todownload = substr(strrchr($tofetch, '-'), 1);
@@ -183,6 +182,12 @@ if($use_old_checkversion == false) {
update_output_window($static_text . " ");
$tofetch = "pfSense-" . $upgrades[$i] . "-" . $todownload . ".tgz";
download_file_with_progress_bar("http://www.pfSense.com/updates/{$tofetch}", "/tmp/{$tofetch}");
+ update_output_window($static_text);
+ system("/etc/rc.firmware delta_firmware /tmp/" . $tofetch);
+ if(file_exists("/tmp/bdiff.log")) {
+ $static_text .= ".\n\nAn md5 mismatch was detected during the update process. Aborting...";
+ break 2;
+ }
if($s == count($aver) - 1) {
$static_text .= ".\n";
} else {
@@ -194,23 +199,6 @@ if($use_old_checkversion == false) {
}
$i++;
}
-
- /* launch external upgrade helper */
- $external_upgrade_helper_text = "";
- if($needs_system_upgrade == true) {
- // XXX: check md5 of downloaded file.
- exec_rc_script_async("/etc/rc.firmware pfSense");
- }
-
- if($needs_kernel_upgrade == true) {
- // XXX: check md5 of downloaded file.
- exec_rc_script_async("/etc/rc.firmware pfSense_kernel");
- }
-
- if($needs_base_upgrade == true) {
- // XXX: check md5 of downloaded file.
- exec_rc_script_async("/etc/rc.firmware pfSense_base");
- }
} else {
if($versions != "") {
update_output_window("Using old checkversion method. Text returned from pfSense.com:\n\n" . $versions . "\n\nUpgrading...");
OpenPOWER on IntegriCloud