diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml
index 8de25c7c..1028340e 100644
--- a/.idea/codeStyleSettings.xml
+++ b/.idea/codeStyleSettings.xml
@@ -15,8 +15,11 @@
+
+
+
-
+
\ No newline at end of file
diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh
index dc21ac97..b81a7dd5 100755
--- a/automated install/basic-install.sh
+++ b/automated install/basic-install.sh
@@ -870,11 +870,17 @@ configureFirewall() {
echo "::: Configuring FirewallD for httpd and dnsmasq.."
firewall-cmd --permanent --add-port=80/tcp --add-port=53/tcp --add-port=53/udp
firewall-cmd --reload
- elif modinfo ip_tables &> /dev/null && iptables -S INPUT | head -n1 | grep -v "ACCEPT" &> /dev/null ; then
- echo "::: Configuring iptables for httpd and dnsmasq.."
- iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
- iptables -A INPUT -p tcp -m tcp --dport 53 -j ACCEPT
- iptables -A INPUT -p udp -m udp --dport 53 -j ACCEPT
+ # Check for proper kernel modules to prevent failure
+ elif modinfo ip_tables &> /dev/null; then
+ # If chain Policy is not ACCEPT or last Rule is not ACCEPT
+ # then check and insert our Rules above the DROP/REJECT Rule.
+ if iptables -S INPUT | head -n1 | grep -qv 'ACCEPT$' || iptables -S INPUT | tail -n1 | grep -qv '^-A.*ACCEPT$'; then
+ # Check chain first, otherwise a new rule will duplicate old ones
+ echo "::: Configuring iptables for httpd and dnsmasq.."
+ iptables -C INPUT -p tcp -m tcp --dport 80 -j ACCEPT &> /dev/null || iptables -I INPUT 1 -p tcp -m tcp --dport 80 -j ACCEPT
+ iptables -C INPUT -p tcp -m tcp --dport 53 -j ACCEPT &> /dev/null || iptables -I INPUT 1 -p tcp -m tcp --dport 53 -j ACCEPT
+ iptables -C INPUT -p udp -m udp --dport 53 -j ACCEPT &> /dev/null || iptables -I INPUT 1 -p udp -m udp --dport 53 -j ACCEPT
+ fi
else
echo "::: No active firewall detected.. skipping firewall configuration."
fi