pbr: detect missing iptables
authorStan Grishin <stangri@melmac.ca>
Mon, 12 Dec 2022 02:52:59 +0000 (02:52 +0000)
committerStan Grishin <stangri@melmac.ca>
Mon, 12 Dec 2022 02:52:59 +0000 (02:52 +0000)
Signed-off-by: Stan Grishin <stangri@melmac.ca>
net/pbr/Makefile
net/pbr/files/etc/init.d/pbr.init

index 0f2842ed81d7653b8f75c36210668b4aa7b05a83..4a7255c487855dd8c6165f981ac7395e55212e66 100644 (file)
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pbr
 PKG_VERSION:=1.0.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
 
index cf807f43340cecd40675caa86c45e6d059320f75..22c8b03a23c6e4f531b34a06e84d087df88c7917 100755 (executable)
@@ -109,6 +109,7 @@ get_text() {
        case "$1" in
                errorConfigValidation) r="Config ($packageConfigFile) validation failure!";;
                errorNoIpFull) r="ip-full binary cannot be found!";;
+               errorNoIptables) r="iptables binary cannot be found!";;
                errorNoIpset) r="Resolver set support (${resolver_set}) requires ipset, but ipset binary cannot be found!";;
                errorNoNft) r="Resolver set support (${resolver_set}) requires nftables, but nft binary cannot be found!";;
                errorResolverNotSupported) r="Resolver set (${resolver_set}) is not supported on this system!";;
@@ -336,6 +337,12 @@ load_environment() {
                        state add 'errorSummary' 'errorNoIpFull'
                        return 1
                fi
+               if ! is_nft; then
+                       if [ -z "$iptables" ] || [ ! -x "$iptables" ]; then
+                               state add 'errorSummary' 'errorNoIptables'
+                               return 1
+                       fi
+               fi
                resolver 'check_support'
        fi