mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-10-14 03:59:13 +00:00
Compare commits
2 commits
73e90e0eaa
...
d804043a18
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d804043a18 | ||
![]() |
0fb0df7056 |
1 changed files with 5 additions and 5 deletions
8
x-ui.sh
8
x-ui.sh
|
@ -1278,8 +1278,8 @@ run_speedtest() {
|
||||||
}
|
}
|
||||||
|
|
||||||
create_iplimit_jails() {
|
create_iplimit_jails() {
|
||||||
# Use default bantime if not passed => 15 minutes
|
# Use default bantime if not passed => 30 minutes
|
||||||
local bantime="${1:-15}"
|
local bantime="${1:-30}"
|
||||||
|
|
||||||
# Uncomment 'allowipv6 = auto' in fail2ban.conf
|
# Uncomment 'allowipv6 = auto' in fail2ban.conf
|
||||||
sed -i 's/#allowipv6 = auto/allowipv6 = auto/g' /etc/fail2ban/fail2ban.conf
|
sed -i 's/#allowipv6 = auto/allowipv6 = auto/g' /etc/fail2ban/fail2ban.conf
|
||||||
|
@ -1406,7 +1406,7 @@ iplimit_main() {
|
||||||
;;
|
;;
|
||||||
5)
|
5)
|
||||||
read -rp "Enter the IP address you want to ban: " ban_ip
|
read -rp "Enter the IP address you want to ban: " ban_ip
|
||||||
if [[ $ban_ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
if [[ $ban_ip =~ ^(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9]))$ || $ban_ip =~ ^(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})$ ]]; then
|
||||||
fail2ban-client set 3x-ipl banip "$ban_ip"
|
fail2ban-client set 3x-ipl banip "$ban_ip"
|
||||||
echo -e "${green}IP Address ${ban_ip} has been banned successfully.${plain}"
|
echo -e "${green}IP Address ${ban_ip} has been banned successfully.${plain}"
|
||||||
else
|
else
|
||||||
|
@ -1416,7 +1416,7 @@ iplimit_main() {
|
||||||
;;
|
;;
|
||||||
6)
|
6)
|
||||||
read -rp "Enter the IP address you want to unban: " unban_ip
|
read -rp "Enter the IP address you want to unban: " unban_ip
|
||||||
if [[ $unban_ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
if [[ $unban_ip =~ ^(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9]))$ || $unban_ip =~ ^(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})$ ]]; then
|
||||||
fail2ban-client set 3x-ipl unbanip "$unban_ip"
|
fail2ban-client set 3x-ipl unbanip "$unban_ip"
|
||||||
echo -e "${green}IP Address ${unban_ip} has been unbanned successfully.${plain}"
|
echo -e "${green}IP Address ${unban_ip} has been unbanned successfully.${plain}"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue