Project

General

Profile

« Previous | Next » 

Revision 873b2f0c

Added by Jim Pingle over 15 years ago

Fix NanoBSD update detection for console update by URL

View differences:

etc/rc.initial.firmware_update
37 37
		die;
38 38
	break;
39 39
	case "1":
40
		echo "\nEnter the URL to the .tgz update file:\n> ";
40
		echo "\nEnter the URL to the .tgz or .img.gz update file:\n> ";
41 41
		$url = chop(fgets($fp));
42 42
		if(!$url) { 
43 43
			fclose($fp);
......
91 91
			if(strstr($url,"bdiff")) {
92 92
				echo "Binary DIFF upgrade file detected...\n";
93 93
				$type = "bdiff";
94
			}
95
			if(strstr($url,"nanobsd")) {
96
				echo "NanoBSD upgrade file detected...\n";			
97
				$type = "nanobsd";	
98
			}			
99
			if(file_exists("/root/firmware.tgz")) {
100
				$type = "normal";	
101
				do_upgrade("/root/firmware.tgz", $type);
102
				exit;
94
			} elseif(strstr($url,"nanobsd")) {
95
				echo "NanoBSD upgrade file detected...\n";
96
				$type = "nanobsd";
103 97
			} else {
104
				echo "\nCould not download update.\n\n";
105
				fclose($fp);
106
				die -1;
98
				$type = "normal";
107 99
			}
100
			do_upgrade("/root/firmware.tgz", $type);
101
			exit;
108 102
		}
109 103
	case "2":
110
		echo "\nEnter the complete path to the .tgz update file: ";
104
		echo "\nEnter the complete path to the .tgz or .img.gz update file: ";
111 105
		$path = chop(fgets($fp));
112 106
		if(!$path) {
113 107
			fclose($fp);
......
192 186
	mark_subsystem_dirty('firmwarelock');
193 187
	check_for_kernel_file();
194 188
	echo "\nOne moment please...\nInvoking firmware upgrade...";
195
	if($type == "bdiff") 
189
	if($type == "bdiff")
196 190
		mwexec_bg("/etc/rc.firmware delta_update $path");
197
	elseif($type == "nanobsd") 
191
	elseif($type == "nanobsd")
198 192
		mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade $path");
199 193
	else
200 194
		mwexec_bg("/etc/rc.firmware pfSenseupgrade $path");

Also available in: Unified diff