File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -28,18 +28,18 @@ if which yum &> /dev/null 2>&1 ; then
2828 firewall-cmd --zone=public --permanent --remove-service=http
2929 firewall-cmd --reload
3030 # If using UFW
31- else ; if [ rpm -q ufw ]; then ufw --force enable && ufw deny http; fi
31+ elif [ rpm -q ufw ]; then ufw --force enable && ufw deny http
3232 fi
3333# For Debian, Ubuntu or derivatives
3434elif apt-get -v > /dev/null 2>&1 ; then
3535 # Check if web server software is installed, stop it if any
3636 if [ $( dpkg-query -W -f=' ${Status}' nginx 2> /dev/null | grep -c " ok installed" ) -eq 1 ]; then service nginx start
3737 elif [ $( dpkg-query -W -f=' ${Status}' apache2 2> /dev/null | grep -c " ok installed" ) -eq 1 ]; then service apache2 start
3838 # If using UFW
39- else ; if [ $( dpkg-query -W -f=' ${Status}' ufw 2> /dev/null | grep -c " ok installed" ) -eq 1 ]; then ufw --force enable && ufw deny http; fi
39+ elif [ $( dpkg-query -W -f=' ${Status}' ufw 2> /dev/null | grep -c " ok installed" ) -eq 1 ]; then ufw --force enable && ufw deny http
4040 fi
4141# Try iptables as a final attempt
4242else
4343 iptables -D INPUT -p tcp --dport 80 -j ACCEPT
4444 service iptables save
45- fi
45+ fi
You can’t perform that action at this time.
0 commit comments