Skip to content

Commit

Permalink
Check-config draft
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <[email protected]>
  • Loading branch information
dereknola committed Mar 14, 2023
1 parent 7d2f997 commit f02b6b3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions contrib/util/check-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit f02b6b3

Please sign in to comment.