diff options
author | jim-p <jimp@pfsense.org> | 2011-03-09 11:23:29 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-03-09 11:23:29 -0500 |
commit | b043503a017b1482a0e188885cd460a4842dcca9 (patch) | |
tree | 1d8fd8a609370384da7507a6938dfff17097dad7 /etc/rc.initial.firmware_update | |
parent | 947fe874607c3122457801afeceaeac77c0ae0ee (diff) | |
download | pfsense-b043503a017b1482a0e188885cd460a4842dcca9.zip pfsense-b043503a017b1482a0e188885cd460a4842dcca9.tar.gz |
Teach the console update by url about the default auto update url.
Diffstat (limited to 'etc/rc.initial.firmware_update')
-rwxr-xr-x | etc/rc.initial.firmware_update | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index 70e1dbc..8d16098 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -15,6 +15,25 @@ echo "."; $g['booting'] = false; +if(isset($config['system']['firmware']['alturl']['enable'])) + $updater_url = "{$config['system']['firmware']['alturl']['firmwareurl']}"; +else + $updater_url = $g['update_url']; + +$nanosize = ""; +if ($g['platform'] == "nanobsd") { + if (file_exists("/etc/nano_use_vga.txt")) + $nanosize = "-nanobsd-vga-"; + else + $nanosize = "-nanobsd-"; + + $nanosize .= strtolower(trim(file_get_contents("/etc/nanosize.txt"))); + $update_filename = "latest{$nanosize}.img.gz"; +} else { + $update_filename = "latest.tgz"; +} +$autoupdateurl = "{$updater_url}/{$update_filename}"; + $fp = fopen('php://stdin', 'r'); echo ".\n\n"; @@ -37,12 +56,15 @@ switch ($command) { die; break; case "1": - echo "\nEnter the URL to the .tgz or .img.gz update file:\n> "; + echo "\nEnter the URL to the .tgz or .img.gz update file. \nType 'auto' to use {$autoupdateurl}\n> "; $url = chop(fgets($fp)); if(!$url) { fclose($fp); die; } + if($url == "auto") { + $url = $autoupdateurl; + } $status = does_url_exist($url); if($status) { conf_mount_rw(); |