diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-01-14 13:39:26 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-01-14 13:39:26 -0500 |
commit | 42d4bdf3342bbfb02334caa5b49c00a70b6ef9f7 (patch) | |
tree | 0946a48d225f3066c9f4c6a3c3b6247608252e05 /src/usr/local/www/pkg_mgr_install.php | |
parent | e1508b51f2e044e077988d6bc7d097da3fd77df9 (diff) | |
download | pfsense-42d4bdf3342bbfb02334caa5b49c00a70b6ef9f7.zip pfsense-42d4bdf3342bbfb02334caa5b49c00a70b6ef9f7.tar.gz |
Revise reboot on upgrade
Diffstat (limited to 'src/usr/local/www/pkg_mgr_install.php')
-rw-r--r-- | src/usr/local/www/pkg_mgr_install.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php index 41819ba..7353e9d 100644 --- a/src/usr/local/www/pkg_mgr_install.php +++ b/src/usr/local/www/pkg_mgr_install.php @@ -123,22 +123,24 @@ if ($_REQUEST['ajax']) { if ($logfile != FALSE) { $resparray = array(); $statusarray = array(); + $code = array(); // Log file is read a line at a time so that we can detect/modify certain entries while (($logline = fgets($logfile)) !== false) { // Check for return codes and replace with suitable strings if (strpos($logline, "_RC=") != false) { - $code = str_replace("__RC=", "", $logline); - $statusarray['reboot_needed'] = (strpos($code, "REBOOT_AFTER") == false) ? "no":"yes"; + $code = explode(" ", $$logline); + $rc = str_replace("__RC=", "", $code[0]); + $statusarray['reboot_needed'] = (strpos($code[1], "REBOOT_AFTER") == false) ? "no":"yes"; - if ($code == 0) { + if ($rc == 0) { $logline = gettext("Success") . "\n"; } else { $logline = gettext("Failed") . "\n"; } $response .= $logline; - $statusarray['exitstatus'] = $code; + $statusarray['exitstatus'] = $rc; } else { $response .= htmlspecialchars($logline); } |