This commit is contained in:
MHSanaei 2025-12-03 21:40:00 +01:00
parent 59491564f9
commit ab7e43807f
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A
3 changed files with 272 additions and 236 deletions

View file

@ -15,7 +15,7 @@ cur_dir=$(pwd)
if [[ -f /etc/os-release ]]; then
source /etc/os-release
release=$ID
elif [[ -f /usr/lib/os-release ]]; then
elif [[ -f /usr/lib/os-release ]]; then
source /usr/lib/os-release
release=$ID
else
@ -44,9 +44,16 @@ install_base() {
ubuntu | debian | armbian)
apt-get update && apt-get install -y -q wget curl tar tzdata
;;
fedora | amzn | virtuozzo | centos | rhel | almalinux | rocky | ol)
fedora | amzn | virtuozzo | rhel | almalinux | rocky | ol)
dnf -y update && dnf install -y -q wget curl tar tzdata
;;
centos)
if [[ "${VERSION_ID}" =~ ^7 ]]; then
yum -y update && yum install -y wget curl tar tzdata
else
dnf -y update && dnf install -y -q wget curl tar tzdata
fi
;;
arch | manjaro | parch)
pacman -Syu && pacman -Syu --noconfirm wget curl tar tzdata
;;
@ -248,7 +255,7 @@ install_x-ui() {
${blue}x-ui legacy${plain} - Legacy version │
${blue}x-ui install${plain} - Install │
${blue}x-ui uninstall${plain} - Uninstall │
└───────────────────────────────────────────────────────┘"
└───────────────────────────────────────────────────────┘"
}
echo -e "${green}Running...${plain}"

View file

@ -47,7 +47,7 @@ fi
if [[ -f /etc/os-release ]]; then
source /etc/os-release
release=$ID
elif [[ -f /usr/lib/os-release ]]; then
elif [[ -f /usr/lib/os-release ]]; then
source /usr/lib/os-release
release=$ID
else
@ -76,9 +76,16 @@ install_base() {
ubuntu | debian | armbian)
apt-get update >/dev/null 2>&1 && apt-get install -y -q wget curl tar tzdata >/dev/null 2>&1
;;
fedora | amzn | virtuozzo | centos | rhel | almalinux | rocky | ol)
fedora | amzn | virtuozzo | rhel | almalinux | rocky | ol)
dnf -y update >/dev/null 2>&1 && dnf install -y -q wget curl tar tzdata >/dev/null 2>&1
;;
centos)
if [[ "${VERSION_ID}" =~ ^7 ]]; then
yum -y update >/dev/null 2>&1 && yum install -y -q wget curl tar tzdata >/dev/null 2>&1
else
dnf -y update >/dev/null 2>&1 && dnf install -y -q wget curl tar tzdata >/dev/null 2>&1
fi
;;
arch | manjaro | parch)
pacman -Syu >/dev/null 2>&1 && pacman -Syu --noconfirm wget curl tar tzdata >/dev/null 2>&1
;;
@ -247,7 +254,7 @@ update_x-ui() {
${blue}x-ui legacy${plain} - Legacy version │
${blue}x-ui install${plain} - Install │
${blue}x-ui uninstall${plain} - Uninstall │
└───────────────────────────────────────────────────────┘"
└───────────────────────────────────────────────────────┘"
}
echo -e "${green}Running...${plain}"

42
x-ui.sh
View file

@ -509,9 +509,16 @@ enable_bbr() {
ubuntu | debian | armbian)
apt-get update && apt-get install -yqq --no-install-recommends ca-certificates
;;
fedora | amzn | virtuozzo | centos | rhel | almalinux | rocky | ol)
fedora | amzn | virtuozzo | rhel | almalinux | rocky | ol)
dnf -y update && dnf -y install ca-certificates
;;
centos)
if [[ "${VERSION_ID}" =~ ^7 ]]; then
yum -y update && yum -y install ca-certificates
else
dnf -y update && dnf -y install ca-certificates
fi
;;
arch | manjaro | parch)
pacman -Sy --noconfirm ca-certificates
;;
@ -1070,9 +1077,15 @@ ssl_cert_issue() {
ubuntu | debian | armbian)
apt-get update && apt-get install socat -y
;;
fedora | amzn | virtuozzo | centos | rhel | almalinux | rocky | ol)
fedora | amzn | virtuozzo | rhel | almalinux | rocky | ol)
dnf -y update && dnf -y install socat
;;
centos)
if [[ "${VERSION_ID}" =~ ^7 ]]; then
yum -y update && yum -y install socat
else
dnf -y update && dnf -y install socat
fi
arch | manjaro | parch)
pacman -Sy --noconfirm socat
;;
@ -1531,12 +1544,16 @@ install_iplimit() {
armbian)
apt-get update && apt-get install fail2ban -y
;;
centos | rhel | almalinux | rocky | ol)
fedora | amzn | virtuozzo | rhel | almalinux | rocky | ol)
dnf -y update && dnf -y install fail2ban
;;
centos)
if [[ "${VERSION_ID}" =~ ^7 ]]; then
yum update -y && yum install epel-release -y
yum -y install fail2ban
;;
fedora | amzn | virtuozzo)
else
dnf -y update && dnf -y install fail2ban
fi
;;
arch | manjaro | parch)
pacman -Syu --noconfirm fail2ban
@ -1631,14 +1648,19 @@ remove_iplimit() {
apt-get purge -y fail2ban -y
apt-get autoremove -y
;;
centos | rhel | almalinux | rocky | ol)
yum remove fail2ban -y
yum autoremove -y
;;
fedora | amzn | virtuozzo)
fedora | amzn | virtuozzo | rhel | almalinux | rocky | ol)
dnf remove fail2ban -y
dnf autoremove -y
;;
centos)
if [[ "${VERSION_ID}" =~ ^7 ]]; then
yum remove fail2ban -y
yum autoremove -y
else
dnf remove fail2ban -y
dnf autoremove -y
fi
;;
arch | manjaro | parch)
pacman -Rns --noconfirm fail2ban
;;