From 9f05043a3268f4d5b823ec34c9980b82769642b4 Mon Sep 17 00:00:00 2001 From: Tilman Kranz Date: Wed, 24 Nov 2021 02:45:24 +0100 Subject: [PATCH] check for "nft" command availability --- nft-edit-ruleset | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nft-edit-ruleset b/nft-edit-ruleset index 2471239..2d2fd39 100755 --- a/nft-edit-ruleset +++ b/nft-edit-ruleset @@ -15,6 +15,13 @@ else default_config_file="" fi +nft=$(command -v nft) + +if test -z "$nft" ; then + echo "ERROR: Command \"nft\" not found; aborted." >&2 + exit 1 +fi + ## # Functions