diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-02-17 00:03:27 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-02-17 00:03:27 +0000 |
commit | e1aea2cda04d9c99759946c845a5cdf1100bbaa0 (patch) | |
tree | 8129a33d7a14029dc168e41041df077796af7841 /etc | |
parent | ca7a3a5c75a388b75c046b16032fc44f0873a207 (diff) | |
download | pfsense-e1aea2cda04d9c99759946c845a5cdf1100bbaa0.zip pfsense-e1aea2cda04d9c99759946c845a5cdf1100bbaa0.tar.gz |
When bdiff is detected in the filename, invoke the binary update
routines.
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.initial.firmware_update | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index 3ece180..5acfe40 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -88,8 +88,10 @@ switch ($command) { echo "\nMD5 checksum matches.\n"; exec("rm -f /root/*.md5"); } + if(stristr($url,"bdiff")) + $type = "bdiff"; if(file_exists("/root/firmware.tgz")) - do_upgrade("/root/firmware.tgz"); + do_upgrade("/root/firmware.tgz", $type); } else { echo "\nCould not download update.\n\n"; fclose($fp); @@ -102,9 +104,11 @@ switch ($command) { fclose($fp); die; } + if(stristr($fp,"bdiff")) + $type = "bdiff"; if(file_exists($path)) { touch($d_fwupenabled_path); - do_upgrade($path); + do_upgrade($path, $type); } else { echo "\nCould not find file.\n\n"; fclose($fp); @@ -148,11 +152,14 @@ function check_for_kernel_file() { } } -function do_upgrade($path) { +function do_upgrade($path, $type) { global $fp; check_for_kernel_file(); echo "\nOne moment please... Invoking firmware upgrade...\n"; - exec("/etc/rc.firmware pfSenseupgrade $path"); + if($type == "bdiff") + exec("/etc/rc.firmware delta_update $path"); + else + exec("/etc/rc.firmware pfSenseupgrade $path"); unlink_if_exists($path); die; } |