From a4147813fcf06bef699f127c2992db79d459ae46 Mon Sep 17 00:00:00 2001 From: Jens Schedel Date: Mon, 24 Jun 2024 10:48:33 +0200 Subject: [PATCH] Check if iptables-persistent is installed with dpkg The command iptables-save is part of the iptables package and NOT of the iptables-persistent package. Signed-off-by: Jens Schedel --- run/ip_tables_utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run/ip_tables_utils.sh b/run/ip_tables_utils.sh index 6f506cf..7657032 100644 --- a/run/ip_tables_utils.sh +++ b/run/ip_tables_utils.sh @@ -46,7 +46,7 @@ ip_tables_installed() { } ip_tables_persistent_installed() { - if which iptables-save 2>/dev/null 1>&2; then + if dpkg-query -W --showformat='${Status}' iptables-persistent | grep "install ok installed" 2>/dev/null 1>&2; then return 0 fi return 1