shell: make require take a tag
This commit is contained in:
+2
-2
@@ -32,7 +32,7 @@ const assert = require('assert'),
|
||||
paths = require('./paths.js'),
|
||||
safe = require('safetydance'),
|
||||
settings = require('./settings.js'),
|
||||
shell = require('./shell.js'),
|
||||
shell = require('./shell.js')('network'),
|
||||
validator = require('validator');
|
||||
|
||||
const SET_BLOCKLIST_CMD = path.join(__dirname, 'scripts/setblocklist.sh');
|
||||
@@ -102,7 +102,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('setBlocklist', [ SET_BLOCKLIST_CMD ], {}));
|
||||
const [error] = await safe(shell.promises.sudo([ SET_BLOCKLIST_CMD ], {}));
|
||||
if (error) throw new BoxError(BoxError.IPTABLES_ERROR, `Error setting blocklist: ${error.message}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user