Improve unban script
This commit is contained in:
@@ -9,10 +9,16 @@ parent=${parent%/*}
|
||||
|
||||
is_root
|
||||
|
||||
[[ $# -lt 1 ]] && echo "Must provide an IP address" && exit 1
|
||||
echo "This script supports one optional argument, an IP address"
|
||||
|
||||
IPADDRESS="$1"
|
||||
if [[ $# -eq 1 ]]; then
|
||||
ip_address="$1"
|
||||
else
|
||||
prompt ip_address
|
||||
fi
|
||||
|
||||
fail2ban-client set sshd unbanip "$IPADDRESS"
|
||||
if fail2ban-client set sshd unbanip "$ip_address"; then
|
||||
echo "IP address $ip_address unbanned"
|
||||
fi
|
||||
|
||||
exit $?
|
||||
Reference in New Issue
Block a user