Update manage_iptables
This commit is contained in:
parent
60ecfa59aa
commit
4c3692b268
@ -110,12 +110,15 @@ check_ip_in_fail2ban() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to list available Fail2ban jails
|
|
||||||
|
|
||||||
|
# Function to list available Fail2ban jails and their status
|
||||||
list_fail2ban_jails() {
|
list_fail2ban_jails() {
|
||||||
echo "Available Fail2ban jails:"
|
echo "Available Fail2ban jails and their status:"
|
||||||
sudo fail2ban-client status | grep "Jail list" | awk -F ": " '{print $2}' | tr ',' '\n' | sed 's/ //g'
|
fail2ban-client status | sed -n 's/,//g;s/.*Jail list://p' | xargs -n1 fail2ban-client status
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Function to remove an IP address from Fail2ban
|
# Function to remove an IP address from Fail2ban
|
||||||
remove_ip_from_fail2ban() {
|
remove_ip_from_fail2ban() {
|
||||||
read -p "Enter the IP address to remove from Fail2ban: " ip_address
|
read -p "Enter the IP address to remove from Fail2ban: " ip_address
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user