This commit is contained in:
Tobias Hopp 2024-03-28 02:27:45 +01:00
parent 0672168541
commit 40ab464995

View File

@ -74,7 +74,7 @@ function initTools(callback) {
function scanNetworks(callback, useSudo) { function scanNetworks(callback, useSudo) {
const cmd = scanner.cmdLine.split(" "); const cmd = scanner.cmdLine.split(" ");
const args = cmd.slice(1); const args = cmd.slice(1);
const child = spawn(cmd[0], args, { stdio: ['ignore', 'pipe', 'pipe'], detached: true }); const child = spawn((useSudo ? "sudo " : "" ) + cmd[0], args, { stdio: ['ignore', 'pipe', 'pipe'], detached: true });
child.on("error", (err) => callback(err, null) ); child.on("error", (err) => callback(err, null) );