diff options
author | jim-p <jimp@pfsense.org> | 2010-05-18 15:21:34 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-05-18 15:22:03 -0400 |
commit | 873b2f0c810b15dc649c2ce71a08a56f01e649a4 (patch) | |
tree | d21ff87a39ad5ca8cbf8ac649bf9178c6a06bbb7 /etc/rc.initial.firmware_update | |
parent | 7382c59deb0e04ce625c7e2820ee9bde3a3ae7c2 (diff) | |
download | pfsense-873b2f0c810b15dc649c2ce71a08a56f01e649a4.zip pfsense-873b2f0c810b15dc649c2ce71a08a56f01e649a4.tar.gz |
Fix NanoBSD update detection for console update by URL
Diffstat (limited to 'etc/rc.initial.firmware_update')
-rwxr-xr-x | etc/rc.initial.firmware_update | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index f510760..70e1dbc 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -37,7 +37,7 @@ switch ($command) { die; break; case "1": - echo "\nEnter the URL to the .tgz update file:\n> "; + echo "\nEnter the URL to the .tgz or .img.gz update file:\n> "; $url = chop(fgets($fp)); if(!$url) { fclose($fp); @@ -91,23 +91,17 @@ switch ($command) { if(strstr($url,"bdiff")) { echo "Binary DIFF upgrade file detected...\n"; $type = "bdiff"; - } - if(strstr($url,"nanobsd")) { - echo "NanoBSD upgrade file detected...\n"; - $type = "nanobsd"; - } - if(file_exists("/root/firmware.tgz")) { - $type = "normal"; - do_upgrade("/root/firmware.tgz", $type); - exit; + } elseif(strstr($url,"nanobsd")) { + echo "NanoBSD upgrade file detected...\n"; + $type = "nanobsd"; } else { - echo "\nCould not download update.\n\n"; - fclose($fp); - die -1; + $type = "normal"; } + do_upgrade("/root/firmware.tgz", $type); + exit; } case "2": - echo "\nEnter the complete path to the .tgz update file: "; + echo "\nEnter the complete path to the .tgz or .img.gz update file: "; $path = chop(fgets($fp)); if(!$path) { fclose($fp); @@ -192,9 +186,9 @@ function do_upgrade($path, $type) { mark_subsystem_dirty('firmwarelock'); check_for_kernel_file(); echo "\nOne moment please...\nInvoking firmware upgrade..."; - if($type == "bdiff") + if($type == "bdiff") mwexec_bg("/etc/rc.firmware delta_update $path"); - elseif($type == "nanobsd") + elseif($type == "nanobsd") mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade $path"); else mwexec_bg("/etc/rc.firmware pfSenseupgrade $path"); |