From 57e9661758ecdcb4d69cf1091a8747a171651932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rouzbeh=E2=80=A0?= <78313022+rqzbeh@users.noreply.github.com> Date: Thu, 11 Jun 2026 01:27:39 +0200 Subject: [PATCH] fix: properly configure fail2ban backend and dependencies on Ubuntu 22.04+ (#5159) (#5184) Co-authored-by: rqzbeh --- x-ui.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/x-ui.sh b/x-ui.sh index b881ffb30..6b18d7666 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -2100,7 +2100,7 @@ install_iplimit() { case "${release}" in ubuntu) apt-get update - if [[ "${os_version}" -ge 24 ]]; then + if [[ "${os_version}" -ge 2400 ]]; then apt-get install python3-pip -y python3 -m pip install pyasynchat --break-system-packages fi @@ -2302,8 +2302,8 @@ create_iplimit_jails() { # Uncomment 'allowipv6 = auto' in fail2ban.conf sed -i 's/#allowipv6 = auto/allowipv6 = auto/g' /etc/fail2ban/fail2ban.conf - # On Debian 12+ fail2ban's default backend should be changed to systemd - if [[ "${release}" == "debian" && ${os_version} -ge 12 ]]; then + # On Debian 12+ and Ubuntu 22.04+ fail2ban's default backend should be changed to systemd + if [[ ( "${release}" == "debian" && ${os_version} -ge 12 ) || ( "${release}" == "ubuntu" && ${os_version} -ge 2200 ) ]]; then sed -i '0,/action =/s/backend = auto/backend = systemd/' /etc/fail2ban/jail.conf fi