From e4296d1183c9c00a3f74f04f0ff118fbeccdf6ed Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Sat, 13 Aug 2005 04:31:29 +0000 Subject: Fix bad firmware logic --- usr/local/www/system_firmware.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index 6c77980..99c5754 100755 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -90,14 +90,17 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { } } - if (!$input_errors && !file_exists($d_firmwarelock_path) && (!$sig_warning || $_POST['sig_override']) && file_exists("{$g['tmp_path']}/firmware.tgz")) { - /* fire up the update script in the background */ - touch($d_firmwarelock_path); - $savemsg = "The firmware is now being updated. The firewall will reboot automatically."; - mwexec_bg("/etc/rc.firmware pfSenseupgrade {$g['tmp_path']}/firmware.tgz"); - } else { - $savemsg = "Firmware image missing or other error, please try again."; - } + /* Check for input errors, firmware locks, warnings, then check for firmware if sig_override is set */ + if (!$input_errors && !file_exists($d_firmwarelock_path) && (!$sig_warning || $_POST['sig_override'])) { + if (!file_exists("{$g['tmp_path']}/firmware.tgz")) { + /* fire up the update script in the background */ + touch($d_firmwarelock_path); + $savemsg = "The firmware is now being updated. The firewall will reboot automatically."; + mwexec_bg("/etc/rc.firmware pfSenseupgrade {$g['tmp_path']}/firmware.tgz"); + } else { + $savemsg = "Firmware image missing or other error, please try again."; + } + } } } } -- cgit v1.1