Files
hartman-server/scripts/usr/local/bin/script-user-unban
2025-08-13 16:32:43 -04:00

21 lines
462 B
Bash
Executable File

#!/usr/bin/env bash
# Unban a fail2ban IP
# Copyright 2021-2025 Bryan C. Roessler
# Licensed under the Apache License, Version 2.0
p="${BASH_SOURCE[0]%/*}"; [[ -r $p/script-functions ]] && . "$p"/script-functions || exit 1
echo "Usage: sudo $0 [ip_address]"
is_root
if [[ $# -eq 1 ]]; then
ip_address="$1"
else
ip_address=$(prompt ip_address)
fi
if fail2ban-client set sshd unbanip "$ip_address"; then
echo "IP address $ip_address unbanned"
fi
exit $?