firewall-cmd --state
returns 0 on 'running' non 0 on 'not running',
so check retval and not text returned. FirewallD conversion to multicall IPTables test
This commit is contained in:
@@ -879,7 +879,7 @@ create_pihole_user() {
|
||||
|
||||
configureFirewall() {
|
||||
# Allow HTTP and DNS traffic
|
||||
if [[ $(firewall-cmd --state) == "running" ]]; then
|
||||
if firewall-cmd --state &> /dev/null; 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."
|
||||
|
Reference in New Issue
Block a user