fail2ban activation with ($DEFCON < 5 ) && ! $isLAN

This commit is contained in:
qo-op 2021-01-31 22:53:23 +01:00
parent e4216ba459
commit bdbdfab86c
1 changed files with 6 additions and 4 deletions

View File

@ -62,11 +62,13 @@ do
echo "!!! NOT MY FRIEND !!! ___________________ # DEFCON : $DEFCON "
if [[ ( $DEFCON < 5 ) && ! $isLAN ]]
then
fail2ban-client add recidive 2>/dev/null 1>&2
fail2ban-client start recidive
fail2ban-client set recidive banip $ip
### IMPORTANT ADD TO /etc/sudoers ###
# $USER ALL=(ALL:ALL) NOPASSWD:/usr/bin/fail2ban-client
sudo fail2ban-client add recidive 2>/dev/null 1>&2
sudo fail2ban-client start recidive
sudo fail2ban-client set recidive banip $ip
# Show ALL banned IP
fail2ban-client status recidive
sudo fail2ban-client status recidive
fi
echo "INFORM _FAIL2BAN STATUS $ip IN ~/.zen/ipfs_swarm/.$ipfsnodeid/_FAIL2BAN"
# INFORM _FAIL2BAN STATUS in ipfs_swarm/.$ipfsnodeid