From f7a17248b730cd0e37e283e939759f0263867eef Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Mon, 23 Jan 2017 14:19:51 -0800 Subject: [PATCH] Warn with whiptail if `firewall-cmd` is running. --- automated install/basic-install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index e60f2f2d..aaaa43ce 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -865,8 +865,10 @@ create_pihole_user() { configureFirewall() { # Allow HTTP and DNS traffic - if firewall-cmd --state &> /dev/null; then - echo "::: Configuring FirewallD for httpd and dnsmasq.." + if [[ $(firewall-cmd --state) == "running" ]]; then + whiptail --title "Firewall in use" --yesno "We have detected a running firewall\n\nPi-hole currently requires HTTP and DNS port access.\n\n\n\nInstall Pi-hole default firewall rules?" ${r} ${c} || \ + { echo -e ":::\n::: Not installing firewall rulesets."; return 1; } + echo -e ":::\n:::\n Configuring FirewallD for httpd and dnsmasq." firewall-cmd --permanent --add-port=80/tcp --add-port=53/tcp --add-port=53/udp firewall-cmd --reload return 0