summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/pkg_mgr_install.php
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2016-01-14 12:38:53 -0500
committerStephen Beaver <sbeaver@netgate.com>2016-01-14 12:39:11 -0500
commit716d553f3ffb89a31358992a6ed2fcf369fb7781 (patch)
tree2d511dffeabcd98b66485938afd0b61938a3681d /src/usr/local/www/pkg_mgr_install.php
parent5815d13659250c8319424268a1c8836928cd8cbf (diff)
downloadpfsense-716d553f3ffb89a31358992a6ed2fcf369fb7781.zip
pfsense-716d553f3ffb89a31358992a6ed2fcf369fb7781.tar.gz
Revised reboot detection
Diffstat (limited to 'src/usr/local/www/pkg_mgr_install.php')
-rw-r--r--src/usr/local/www/pkg_mgr_install.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php
index 3edd21e..4bd71f2 100644
--- a/src/usr/local/www/pkg_mgr_install.php
+++ b/src/usr/local/www/pkg_mgr_install.php
@@ -129,10 +129,8 @@ if ($_REQUEST['ajax']) {
// 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";
- if (strpos($code, "REBOOT_AFTER") != false) {
- $statusarray['reboot_needed'] = "yes";
- }
if ($code == 0) {
$logline = gettext("Success") . "\n";
} else {
@@ -140,7 +138,7 @@ if ($_REQUEST['ajax']) {
}
$response .= $logline;
- $statusarray = array('exitstatus' => $code);
+ $statusarray['exitstatus'] = $code;
} else {
$response .= htmlspecialchars($logline);
}
@@ -568,6 +566,8 @@ function getLogsStatus() {
json = jQuery.parseJSON(response);
+// alert("JSON data: " + JSON.stringify(json));
+
if (json.log != "not ready") {
// Write the log file to the "output" textarea
$('#output').html(json.log);
@@ -599,6 +599,7 @@ function getLogsStatus() {
if ((json.pid == "stopped") && (progress == 0) && (json.exitstatus == 0)) {
show_success();
repeat = false;
+
if (json.reboot_needed == "yes") {
$('#reboot_needed').val("yes");
}
OpenPOWER on IntegriCloud