1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-18 06:08:21 +00:00

Warn with whiptail if firewall-cmd is running.

This commit is contained in:
Dan Schaper 2017-01-23 14:19:51 -08:00
parent 62a5e36afd
commit f7a17248b7
No known key found for this signature in database
GPG Key ID: 572E999E385B7BFC

View File

@ -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