Check for iptables, and install if missing (#506)

This commit is contained in:
Daniel Markstedt 2021-12-04 11:07:17 -08:00 committed by GitHub
parent b9f2d3d448
commit 47717ad0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -546,6 +546,13 @@ function setupWirelessNetworking() {
echo "Modified /etc/sysctl.conf"
fi
# Check if iptables is installed
if [ `apt-cache policy iptables | grep Installed | grep -c "(none)"` -eq 0 ]; then
echo "iptables is already installed"
else
sudo apt-get install iptables --assume-yes </dev/null
fi
sudo iptables --flush
sudo iptables -t nat -F
sudo iptables -X