Path : /proc/2/task/2/root/proc/3/root/proc/self/root/proc/2/cwd/var/lib/zabbix/ |
Current File : //proc/2/task/2/root/proc/3/root/proc/self/root/proc/2/cwd/var/lib/zabbix/fail2ban_check.sh |
#!/bin/bash testip="$1" #Remove test IP if exist fail2ban-client set sshd unbanip $testip >/dev/null 2>&1 #Ban test IP fail2ban-client set sshd banip $testip >/dev/null 2>&1 sleep 5 #Check that ip was added to the iptables rules iptables-save | grep f2b-ssh | grep -q $testip echo "$?" #Remove test IP if exist fail2ban-client set sshd unbanip $testip >/dev/null 2>&1