shell: make shell.sudo promise based and waitable

This commit is contained in:
Girish Ramakrishnan
2025-07-16 21:53:22 +02:00
parent 32d07e7959
commit 989d843fcb
15 changed files with 86 additions and 64 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ async function setBlocklist(blocklist, auditSource) {
// this is done only because it's easier for the shell script and the firewall service to get the value
if (!safe.fs.writeFileSync(paths.FIREWALL_BLOCKLIST_FILE, blocklist + '\n', 'utf8')) throw new BoxError(BoxError.FS_ERROR, safe.error.message);
const [error] = await safe(shell.promises.sudo([ SET_BLOCKLIST_CMD ], {}));
const [error] = await safe(shell.sudo([ SET_BLOCKLIST_CMD ], {}));
if (error) throw new BoxError(BoxError.IPTABLES_ERROR, `Error setting blocklist: ${error.message}`);
}