#!/bin/bash tmp=$(cat /etc/redhat-release | grep '9\.[0-9]') if [[ "X${tmp}" == 'X' ]] then echo "This script onlu runs on version 9 (RHELish)" exit 2 fi # now do this dnf -y install fail2ban cd /etc/fail2ban wget http://repo.hpc.lsu.edu/files/misc/fail2ban/fail2ban.local wget http://repo.hpc.lsu.edu/files/misc/fail2ban/jail.local systemctl start fail2ban systemctl status fail2ban if [[ $? -eq 0 ]] then systemctl enable --now fail2ban else echo "fail2ban Failed!" exit 3 fi