Created
November 9, 2017 00:34
-
-
Save haryx8/d835e892a026a72f9ed0e15f1b9702ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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