Some additions and updates to x-ui.sh

This commit is contained in:
somebodywashere 2023-06-24 11:00:20 +00:00
parent a5d29bd2d7
commit 247d6b4709

13
x-ui.sh
View file

@ -672,7 +672,7 @@ run_speedtest() {
}
iplimit_main() {
echo -e "${green}\t1.${plain} Install Fail2ban and configure IP Limit"
echo -e "\n${green}\t1.${plain} Install Fail2ban and configure IP Limit"
echo -e "${green}\t2.${plain} Change Ban Duration"
echo -e "${green}\t3.${plain} Unban Everyone"
echo -e "${green}\t4.${plain} Check Logs"
@ -700,12 +700,22 @@ iplimit_main() {
fi
iplimit_main ;;
3)
confirm "Proceed with Unbanning everyone from IP Limit jail?" "y"
if [[ $? == 0 ]]; then
fail2ban-client reload --restart --unban 3x-ipl
echo -e "${green}All users Unbanned successfully.${plain}"
iplimit_main
else
echo -e "${yellow}Cancelled.${plain}"
fi
iplimit_main ;;
4)
if test -f "/var/log/3xipl-banned.log"; then
if [[ -s "/var/log/3xipl-banned.log" ]]; then
cat /var/log/3xipl-banned.log
else
echo -e "${red}Log file is empty.${plain}\n"
fi
else
echo -e "${red}Log file not found. Please Install Fail2ban and IP Limit first.${plain}\n"
iplimit_main
@ -830,6 +840,7 @@ remove_iplimit(){
echo -e "${red}Unsupported operating system. Please uninstall Fail2ban manually.${plain}\n"
exit 1 ;;
esac
rm -rf /etc/fail2ban/*
echo -e "${green}Fail2ban and IP Limit removed successfully!${plain}\n"
before_show_menu ;;
0)