Add a Makefile to make it easier to deploy the configuration master
authorAntonio Ospite <ao2@ao2.it>
Fri, 27 Apr 2018 08:50:54 +0000 (10:50 +0200)
committerAntonio Ospite <ao2@ao2.it>
Fri, 27 Apr 2018 08:52:36 +0000 (10:52 +0200)
Makefile [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
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