Skip to content

Instantly share code, notes, and snippets.

@haryx8
Created November 9, 2017 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haryx8/d835e892a026a72f9ed0e15f1b9702ce to your computer and use it in GitHub Desktop.
Save haryx8/d835e892a026a72f9ed0e15f1b9702ce to your computer and use it in GitHub Desktop.
#!/bin/bash
black=`tput setaf 0`
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
blue=`tput setaf 4`
magenta=`tput setaf 5`
cyan=`tput setaf 6`
white=`tput setaf 7`
reset=`tput sgr0`
clear
echo "${red}#####################"
echo "# LIST OF BANNED IP #"
echo "#####################${reset}"
iptables -L -n
echo "${white}#############################"
read -p "# ENTER DESIRE IP TO UNBAN: " ip
echo "#############################${reset}"
if [[ ! -z "$ip" ]]; then
echo "${blue}############"
echo "# UNBAN IP #"
echo "############${reset}"
fail2ban-client set nginx-naxsi unbanip $ip
fail2ban-client set nginx-nohome unbanip $ip
fail2ban-client set nginx-http-auth unbanip $ip
fail2ban-client set nginx-botsearch unbanip $ip
echo "${red}#####################"
echo "# LIST OF BANNED IP #"
echo "#####################${reset}"
iptables -L -n
fi
echo "${cyan}##########"
echo "# FINISH #"
echo "##########${reset}"
echo -e "\033[33;5;7m(c)2017 hary@sgo.co.id\033[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment