Browse Source

fix syntax of ufw command

develop
Rob Colbert 2 years ago
parent
commit
a04028c7cc
  1. 2
      src/methods/Deny.ts

2
src/methods/Deny.ts

@ -32,7 +32,7 @@ async function address(address: string, port?: number, protocol?: PortProtocol)
if (!checkPort) return false; if (!checkPort) return false;
}; };
let command = await runCommand(`echo "y" | sudo ufw ${shouldDryRunDuringTesting} ufw insert 1 deny from ${address} ${port ? `to any port ${port}` : ""} ${protocol ? `proto ${protocol}` : ""}`); let command = await runCommand(`echo "y" | sudo ufw ${shouldDryRunDuringTesting} insert 1 deny from ${address} ${port ? `to any port ${port}` : ""} ${protocol ? `proto ${protocol}` : ""}`);
return command ? isAddedOrUpdated(command) : false; return command ? isAddedOrUpdated(command) : false;
} catch (err) { } catch (err) {
throw err; throw err;

Loading…
Cancel
Save