shell: make shell.sudo promise based and waitable
This commit is contained in:
+1
-1
@@ -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}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user