mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-08-31 23:36:18 +00:00
Update x-ui.sh to use release variable for install packages
This commit is contained in:
parent
5b45b53696
commit
295f705684
1 changed files with 37 additions and 29 deletions
40
x-ui.sh
40
x-ui.sh
|
@ -296,18 +296,21 @@ enable_bbr() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check the OS and install necessary packages
|
# Check the OS and install necessary packages
|
||||||
if [[ "$(cat /etc/os-release | grep -E '^ID=' | awk -F '=' '{print $2}')" == "ubuntu" ]]; then
|
case "${release}" in
|
||||||
|
ubuntu|debian)
|
||||||
sudo apt-get update && sudo apt-get install -yqq --no-install-recommends ca-certificates
|
sudo apt-get update && sudo apt-get install -yqq --no-install-recommends ca-certificates
|
||||||
elif [[ "$(cat /etc/os-release | grep -E '^ID=' | awk -F '=' '{print $2}')" == "debian" ]]; then
|
;;
|
||||||
sudo apt-get update && sudo apt-get install -yqq --no-install-recommends ca-certificates
|
centos)
|
||||||
elif [[ "$(cat /etc/os-release | grep -E '^ID=' | awk -F '=' '{print $2}')" == "fedora" ]]; then
|
|
||||||
sudo dnf -y update && sudo dnf -y install ca-certificates
|
|
||||||
elif [[ "$(cat /etc/os-release | grep -E '^ID=' | awk -F '=' '{print $2}')" == "centos" ]]; then
|
|
||||||
sudo yum -y update && sudo yum -y install ca-certificates
|
sudo yum -y update && sudo yum -y install ca-certificates
|
||||||
else
|
;;
|
||||||
echo "Unsupported operating system. Please check the script and install the necessary packages manually."
|
fedora)
|
||||||
|
sudo dnf -y update && sudo dnf -y install ca-certificates
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e "${red}Unsupported operating system. Please check the script and install the necessary packages manually.${plain}\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Enable BBR
|
# Enable BBR
|
||||||
echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf
|
echo "net.core.default_qdisc=fq" | sudo tee -a /etc/sysctl.conf
|
||||||
|
@ -549,11 +552,17 @@ ssl_cert_issue() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# install socat second
|
# install socat second
|
||||||
if [[ "${release}" == "centos" ]] || [[ "${release}" == "fedora" ]]; then
|
case "${release}" in
|
||||||
yum install socat -y
|
ubuntu|debian)
|
||||||
else
|
apt update && apt install socat -y ;;
|
||||||
apt install socat -y
|
centos)
|
||||||
fi
|
yum -y update && yum -y install socat ;;
|
||||||
|
fedora)
|
||||||
|
dnf -y update && dnf -y install socat ;;
|
||||||
|
*)
|
||||||
|
echo -e "${red}Unsupported operating system. Please check the script and install the necessary packages manually.${plain}\n"
|
||||||
|
exit 1 ;;
|
||||||
|
esac
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
LOGE "install socat failed, please check logs"
|
LOGE "install socat failed, please check logs"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -628,11 +637,10 @@ ssl_cert_issue() {
|
||||||
ls -lah cert/*
|
ls -lah cert/*
|
||||||
chmod 755 $certPath/*
|
chmod 755 $certPath/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
warp_cloudflare() {
|
warp_cloudflare() {
|
||||||
echo -e "${green}\t1.${plain} install WARP"
|
echo -e "${green}\t1.${plain} Install WARP socks5 proxy"
|
||||||
echo -e "${green}\t2.${plain} Account Type (free, plus, team)"
|
echo -e "${green}\t2.${plain} Account Type (free, plus, team)"
|
||||||
echo -e "${green}\t3.${plain} Turn on/off WireProxy"
|
echo -e "${green}\t3.${plain} Turn on/off WireProxy"
|
||||||
echo -e "${green}\t4.${plain} Uninstall WARP"
|
echo -e "${green}\t4.${plain} Uninstall WARP"
|
||||||
|
|
Loading…
Reference in a new issue