this should fix it
This commit is contained in:
7
harden
7
harden
@@ -587,11 +587,8 @@ if [[ -n "$OLD_PORTS" ]]; then
|
|||||||
for port in "${OLD_PORTS[@]}"; do
|
for port in "${OLD_PORTS[@]}"; do
|
||||||
# Deny the port in the firewall
|
# Deny the port in the firewall
|
||||||
case "$currentFirewall" in
|
case "$currentFirewall" in
|
||||||
ufw)
|
ufw) # There are two rules by default for ipv4 and ipv6
|
||||||
PORT_RULE_NUMS="$(sudo ufw status numbered | grep -i "$port" | grep -oP '\[.*?\]' | grep -o '[0-9]')"
|
yes | sudo ufw delete allow "$port"/tcp
|
||||||
for PORT_RULE_NUM in ${PORT_RULE_NUMS[@]}; do
|
|
||||||
yes | sudo ufw delete "$PORT_RULE_NUM"
|
|
||||||
done
|
|
||||||
;;
|
;;
|
||||||
firewalld)
|
firewalld)
|
||||||
sudo firewall-cmd --permanent --remove-port="$port"/tcp
|
sudo firewall-cmd --permanent --remove-port="$port"/tcp
|
||||||
|
|||||||
Reference in New Issue
Block a user