From f02b6b3e60295dcbe4b7410d478ff32560d18571 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Tue, 8 Nov 2022 08:36:08 -0800 Subject: [PATCH] Check-config draft Signed-off-by: Derek Nola --- contrib/util/check-config.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/contrib/util/check-config.sh b/contrib/util/check-config.sh index eda07bc2385a..7a23ddd33eda 100755 --- a/contrib/util/check-config.sh +++ b/contrib/util/check-config.sh @@ -177,8 +177,17 @@ echo if [ -s .links ]; then while read file link; do if [ "$(readlink $file)" != "$link" ]; then - wrap_bad '- links' "$file should link to $link" - linkFail=1 + FLINK="$(readlink $file)" + echo "LINK $FLINK $link" + # If no iptables is installed on the host system, the symlink will be different + if [ "$(readlink $file)" = "xtables-legacy-multi" ]; then + wrap_warn "- $file" "symlink to xtables-legacy-multi" + elif [ "$(readlink $file)" = "xtables-nft-multi" ]; then + wrap_warn "- $file" "symlink to xtables-nft-multi" + else + wrap_bad "- $file" "symlink to $link" + linkFail=1 + fi fi done <.links if [ $linkFail -eq 0 ]; then @@ -222,6 +231,8 @@ echo iptablesVersion=$(echo $iptablesInfo | awk '{ print $2 }') label="$(dirname $iptablesCmd) $iptablesInfo" fi + iptablesMode=$(echo $iptablesInfo | awk '{ print $3 }') + echo "HELP $iptablesCmd $iptablesVersion $iptablesMode" if echo "$iptablesVersion" | grep -v -q -E '^v[0-9]'; then [ "$iptablesCmd" ] || iptablesCmd="unknown iptables" wrap_warn "- $iptablesCmd" "unknown version: $iptablesInfo"