Fix sudo bash command and preserve console output

This commit is contained in:
2026-01-01 17:52:53 +11:00
parent 1d149443d5
commit 84ac59485c
2 changed files with 21 additions and 18 deletions

View File

@@ -229,8 +229,9 @@ async function checkScanStatus() {
stopStatusPolling();
}
// Update console with log content
if (consoleOutput && (result.logContent || result.workspaceOutput)) {
// Update console with log content - only if there's actual content
if (consoleOutput) {
if (result.logContent || result.workspaceOutput) {
let output = "UltyScan Console\n";
output += "================\n";
if (result.latestLogFile) {
@@ -248,6 +249,8 @@ async function checkScanStatus() {
consoleOutput.textContent = output;
consoleOutput.scrollTop = consoleOutput.scrollHeight;
}
// Don't clear console if there's no log content - keep existing content
}
} catch (error) {
console.error("Status check failed:", error);
}

View File

@@ -15,7 +15,7 @@ if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
}
// Configuration
define('SNIPER_PATH', 'sudo /usr/share/sniper/sniper');
define('SNIPER_PATH', 'sudo bash /usr/share/sniper/sniper');
define('LOG_DIR', '/var/log/ultyscan');
// Ensure log directory exists