From 45587194e556c252342c36e3c6f156eea1687b58 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sat, 31 Dec 2016 21:33:05 -0800 Subject: [PATCH] Regex fun Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index b81a7dd5..47a8827d 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -874,7 +874,7 @@ configureFirewall() { 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 + if iptables -S INPUT | head -n1 | grep -qv 'ACCEPT$' || iptables -S INPUT | tail -n1 | grep -qv '(^-A\|^-P).*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