Skip to content

Commit

Permalink
fix(ansible): update iptables path
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoIeni committed Oct 1, 2024
1 parent 963e875 commit 378663e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ansible/roles/common/templates/networking/firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ set -euo pipefail
IFS=$'\n\t'

# Check if ip6tables is supported by the machine
if which ip6tables >/dev/null 2>&1 && /sbin/ip6tables -L >/dev/null 2>&1; then
if which ip6tables >/dev/null 2>&1 && /usr/sbin/ip6tables -L >/dev/null 2>&1; then
IPv6=true
COMMANDS=( "/sbin/iptables" "/sbin/ip6tables" )
COMMANDS=( "/usr/sbin/iptables" "/usr/sbin/ip6tables" )

echo "Operating on the following protocols: ipv4, ipv6"
else
IPv6=false
COMMANDS=( "/sbin/iptables" )
COMMANDS=( "/usr/sbin/iptables" )

echo "Operating on the following protocols: ipv4"
fi
Expand All @@ -31,12 +31,12 @@ cmd() {
}

cmd4() {
"/sbin/iptables" $@
"/usr/sbin/iptables" $@
}

cmd6() {
if "${IPv6}"; then
"/sbin/ip6tables" $@
"/usr/sbin/ip6tables" $@
fi
}

Expand Down

0 comments on commit 378663e

Please sign in to comment.