diff --git a/script-user-remove b/script-user-remove index 80924936..19ef56eb 100755 --- a/script-user-remove +++ b/script-user-remove @@ -5,8 +5,6 @@ parent="${BASH_SOURCE[0]}" parent=${parent%/*} -unset user - [[ -f $parent/script-functions ]] && . "$parent"/script-functions || exit 1 is_root diff --git a/script-user-unban b/script-user-unban index 40151721..8849eb89 100755 --- a/script-user-unban +++ b/script-user-unban @@ -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 $? \ No newline at end of file