diff options
author | NewEraCracker <neweracracker@gmail.com> | 2016-01-14 18:45:53 +0000 |
---|---|---|
committer | NewEraCracker <neweracracker@gmail.com> | 2016-01-14 18:45:53 +0000 |
commit | 3d62415f4d4678951b8715e26832d5541ce76d4e (patch) | |
tree | a012c8fa150500da512ec15f0f846d6a46a44fc2 /src/usr/local/www/pkg_mgr_install.php | |
parent | 0afa102ed8850995c7c20a090a63d7a16912ef91 (diff) | |
parent | 42d4bdf3342bbfb02334caa5b49c00a70b6ef9f7 (diff) | |
download | pfsense-3d62415f4d4678951b8715e26832d5541ce76d4e.zip pfsense-3d62415f4d4678951b8715e26832d5541ce76d4e.tar.gz |
Merge remote-tracking branch 'upstream/master' into strpos-fixes
Conflicts:
src/usr/local/www/pkg_mgr_install.php
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 8bbf4b4..df9c4aa 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); } |