From: Antonio Ospite <ao2@ao2.it>
Date: Thu, 3 May 2018 08:57:48 +0000 (+0200)
Subject: Makefile: ignore error command if nft is not found
X-Git-Url: https://git.ao2.it/config/iptables.git/commitdiff_plain/f44ca91b15e46f2f585daff1717ed90a7c75b89b?ds=sidebyside

Makefile: ignore error command if nft is not found

And while at it, since "command" was using the absolute path to cover
the case of /usr/sbin not being in PATH, we might as well use "test -x"
directly.
---

diff --git a/Makefile b/Makefile
index 1c26fe1..9436a66 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 all:
 
 deploy-workstation:
-	command -v /usr/sbin/nft > /dev/null && sudo nft flush ruleset
+	-[ -x /usr/sbin/nft ] && sudo nft flush ruleset
 	sudo ./iptables-workstation.sh
 	sudo iptables-save > iptables
 	sudo ip6tables-save > ip6tables