Skip to content

Commit

Permalink
Merge pull request #593 from rust-lang/fix-ansible-update-iptables-path
Browse files Browse the repository at this point in the history
fix(ansible): update iptables path
  • Loading branch information
MarcoIeni authored Oct 1, 2024
2 parents 963e875 + 378663e commit 0b42c56
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 0b42c56

Please sign in to comment.