ensure firewalld is running before configuration
This commit is contained in:
@ -744,10 +744,13 @@ setUser(){
|
|||||||
configureFirewall() {
|
configureFirewall() {
|
||||||
# Allow HTTP and DNS traffic
|
# Allow HTTP and DNS traffic
|
||||||
if [ -x "$(command -v firewall-cmd)" ]; then
|
if [ -x "$(command -v firewall-cmd)" ]; then
|
||||||
$SUDO echo "::: Configuring firewalld for httpd and dnsmasq.."
|
$SUDO firewall-cmd --state > /dev/null
|
||||||
$SUDO firewall-cmd --zone=public --permanent --add-service=http
|
if [[ $? -eq 0 ]]; then
|
||||||
$SUDO firewall-cmd --zone=public --permanent --add-service=dns
|
$SUDO echo "::: Configuring firewalld for httpd and dnsmasq.."
|
||||||
$SUDO firewall-cmd --reload
|
$SUDO firewall-cmd --zone=public --permanent --add-service=http
|
||||||
|
$SUDO firewall-cmd --zone=public --permanent --add-service=dns
|
||||||
|
$SUDO firewall-cmd --reload
|
||||||
|
fi
|
||||||
elif [ -x "$(command -v iptables)" ]; then
|
elif [ -x "$(command -v iptables)" ]; then
|
||||||
$SUDO echo "::: Configuring iptables for httpd and dnsmasq.."
|
$SUDO echo "::: Configuring iptables for httpd and dnsmasq.."
|
||||||
$SUDO iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
|
$SUDO iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
|
||||||
|
Reference in New Issue
Block a user