summaryrefslogtreecommitdiffstats
path: root/etc/rc.initial.firmware_update
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-04-16 22:20:48 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-04-16 22:21:31 -0400
commit6e75ac00d99903e9ba73bc385b0e152b30996d53 (patch)
tree23128f7119f06c921d1c28211eb80f4319644995 /etc/rc.initial.firmware_update
parent50a9d5b9aae284f3027d00685ab80da6ee6b5e3b (diff)
downloadpfsense-6e75ac00d99903e9ba73bc385b0e152b30996d53.zip
pfsense-6e75ac00d99903e9ba73bc385b0e152b30996d53.tar.gz
Correct ordering, use a lock file. Launch upgrade in bg and look for lock file to guess if upgrade is in progress
Diffstat (limited to 'etc/rc.initial.firmware_update')
-rwxr-xr-xetc/rc.initial.firmware_update13
1 files changed, 7 insertions, 6 deletions
diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update
index a9d1064..a6b1011 100755
--- a/etc/rc.initial.firmware_update
+++ b/etc/rc.initial.firmware_update
@@ -153,15 +153,16 @@ function check_for_kernel_file() {
}
function do_upgrade($path, $type) {
- global $fp;
check_for_kernel_file();
- echo "\nOne moment please... Invoking firmware upgrade...\n";
+ echo "\nOne moment please...\nInvoking firmware upgrade... ";
if($type == "bdiff")
- exec("/etc/rc.firmware delta_update $path");
+ mwexec_bg("/etc/rc.firmware delta_update $path");
else
- exec("/etc/rc.firmware pfSenseupgrade $path");
- unlink_if_exists($path);
- die;
+ mwexec_bg("/etc/rc.firmware pfSenseupgrade $path");
+ sleep(1);
+ while(file_exists("{$g['varrun_path']}/firmware.lock"))
+ sleep(1);
+ echo "Done. Rebooting...\n\n";
}
exec("rm -f /root/*.md5");
OpenPOWER on IntegriCloud