mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Regex fun
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
ccbf391913
commit
45587194e5
1 changed files with 1 additions and 1 deletions
|
@ -874,7 +874,7 @@ configureFirewall() {
|
||||||
elif modinfo ip_tables &> /dev/null; then
|
elif modinfo ip_tables &> /dev/null; then
|
||||||
# If chain Policy is not ACCEPT or last Rule is not ACCEPT
|
# If chain Policy is not ACCEPT or last Rule is not ACCEPT
|
||||||
# then check and insert our Rules above the DROP/REJECT Rule.
|
# 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
|
# Check chain first, otherwise a new rule will duplicate old ones
|
||||||
echo "::: Configuring iptables for httpd and dnsmasq.."
|
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 80 -j ACCEPT &> /dev/null || iptables -I INPUT 1 -p tcp -m tcp --dport 80 -j ACCEPT
|
||||||
|
|
Loading…
Reference in a new issue