From: Antonio Ospite Date: Fri, 27 Apr 2018 08:50:54 +0000 (+0200) Subject: Add a Makefile to make it easier to deploy the configuration X-Git-Url: https://git.ao2.it/config/nftables.git/commitdiff_plain/HEAD?hp=874baf05d48a4c7216edbb6ac4aebaaa0059ad84 Add a Makefile to make it easier to deploy the configuration --- diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e934f47 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +all: + +deploy-workstation: + if ! diff -q /etc/nftables.conf nftables-workstation.nft > /dev/null; \ + then \ + sudo cp nftables-workstation.nft /etc/nftables.conf; \ + sudo etckeeper vcs commit -m "nftables.conf: import latest upstream config" -- nftables.conf; \ + fi + for ipt in iptables ip6tables; \ + do \ + sudo $$ipt -F; \ + sudo $$ipt -X; \ + for chain in INPUT OUTPUT FORWARD;\ + do \ + sudo $$ipt -P $$chain ACCEPT; \ + done \ + done + sudo systemctl restart nftables.service