Skip to content

Commit

Permalink
A few updates (#1566)
Browse files Browse the repository at this point in the history
* Update install.sh

* Update x-ui.sh

* Update README.md
  • Loading branch information
quydang04 committed Jan 12, 2024
1 parent 590a8f0 commit 491f7ae
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -374,13 +374,14 @@ XUI_BIN_FOLDER="bin" XUI_DB_FOLDER="/etc/x-ui" go build main.go
## OS

- Ubuntu 20.04+
- Debian 10+
- Debian 11+
- CentOS 8+
- Fedora 36+
- Arch Linux
- Manjaro
- Armbian
- AlmaLinux 9+
- Rockylinux 9+

## Preview

Expand Down
15 changes: 10 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,28 @@ if [[ "${release}" == "centos" ]]; then
fi
elif [[ "${release}" == "ubuntu" ]]; then
if [[ ${os_version} -lt 20 ]]; then
echo -e "${red}please use Ubuntu 20 or higher version!${plain}\n" && exit 1
echo -e "${red} Please use Ubuntu 20 or higher version!${plain}\n" && exit 1
fi

elif [[ "${release}" == "fedora" ]]; then
if [[ ${os_version} -lt 36 ]]; then
echo -e "${red}please use Fedora 36 or higher version!${plain}\n" && exit 1
echo -e "${red} Please use Fedora 36 or higher version!${plain}\n" && exit 1
fi

elif [[ "${release}" == "debian" ]]; then
if [[ ${os_version} -lt 10 ]]; then
echo -e "${red} Please use Debian 10 or higher ${plain}\n" && exit 1
if [[ ${os_version} -lt 11 ]]; then
echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1
fi

elif [[ "${release}" == "almalinux" ]]; then
if [[ ${os_version} -lt 9 ]]; then
echo -e "${red} Please use AlmaLinux 9 or higher ${plain}\n" && exit 1
fi

elif [[ "${release}" == "rocky" ]]; then
if [[ ${os_version} -lt 9 ]]; then
echo -e "${red} Please use RockyLinux 9 or higher ${plain}\n" && exit 1
fi
elif [[ "${release}" == "arch" ]]; then
echo "Your OS is ArchLinux"
elif [[ "${release}" == "manjaro" ]]; then
Expand All @@ -72,7 +77,7 @@ fi

install_base() {
case "${release}" in
centos|fedora|almalinux)
centos|fedora|almalinux|rocky)
yum -y update && yum install -y -q wget curl tar
;;
arch|manjaro)
Expand Down
16 changes: 10 additions & 6 deletions x-ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,17 @@ elif [[ "${release}" == "fedora" ]]; then
echo -e "${red}please use Fedora 36 or higher version! ${plain}\n" && exit 1
fi
elif [[ "${release}" == "debian" ]]; then
if [[ ${os_version} -lt 10 ]]; then
echo -e "${red} Please use Debian 10 or higher ${plain}\n" && exit 1
if [[ ${os_version} -lt 11 ]]; then
echo -e "${red} Please use Debian 11 or higher ${plain}\n" && exit 1
fi
elif [[ "${release}" == "almalinux" ]]; then
if [[ ${os_version} -lt 9 ]]; then
echo -e "${red} Please use Almalinux 9 or higher ${plain}\n" && exit 1
fi
elif [[ "${release}" == "rocky" ]]; then
if [[ ${os_version} -lt 9 ]]; then
echo -e "${red} Please use Rockylinux 9 or higher ${plain}\n" && exit 1
fi
elif [[ "${release}" == "arch" ]]; then
echo "Your OS is ArchLinux"
elif [[ "${release}" == "manjaro" ]]; then
Expand Down Expand Up @@ -347,7 +351,7 @@ enable_bbr() {
ubuntu|debian)
apt-get update && apt-get install -yqq --no-install-recommends ca-certificates
;;
centos)
centos|almalinux|rocky)
yum -y update && yum -y install ca-certificates
;;
fedora)
Expand Down Expand Up @@ -609,7 +613,7 @@ ssl_cert_issue() {
case "${release}" in
ubuntu|debian|armbian)
apt update && apt install socat -y ;;
centos)
centos|almalinux|rocky)
yum -y update && yum -y install socat ;;
fedora)
dnf -y update && dnf -y install socat ;;
Expand Down Expand Up @@ -979,7 +983,7 @@ install_iplimit() {
case "${release}" in
ubuntu|debian)
apt update && apt install fail2ban -y ;;
centos)
centos|almalinux|rocky)
yum -y update && yum -y install fail2ban ;;
fedora)
dnf -y update && dnf -y install fail2ban ;;
Expand Down Expand Up @@ -1042,7 +1046,7 @@ remove_iplimit(){
case "${release}" in
ubuntu|debian)
apt-get purge fail2ban -y;;
centos)
centos|almalinux|rocky)
yum remove fail2ban -y;;
fedora)
dnf remove fail2ban -y;;
Expand Down

0 comments on commit 491f7ae

Please sign in to comment.