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
|
||||
# Deny the port in the firewall
|
||||
case "$currentFirewall" in
|
||||
ufw)
|
||||
PORT_RULE_NUMS="$(sudo ufw status numbered | grep -i "$port" | grep -oP '\[.*?\]' | grep -o '[0-9]')"
|
||||
for PORT_RULE_NUM in ${PORT_RULE_NUMS[@]}; do
|
||||
yes | sudo ufw delete "$PORT_RULE_NUM"
|
||||
done
|
||||
ufw) # There are two rules by default for ipv4 and ipv6
|
||||
yes | sudo ufw delete allow "$port"/tcp
|
||||
;;
|
||||
firewalld)
|
||||
sudo firewall-cmd --permanent --remove-port="$port"/tcp
|
||||
|
||||
Reference in New Issue
Block a user