2023-10-16 22:24:49 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
echo -e "\nChecking that minimal requirements are ok"
|
|
|
|
|
|
|
|
|
|
# Ensure the OS is compatible with the launcher
|
|
|
|
|
if [ -f /etc/centos-release ]; then
|
|
|
|
|
inst() {
|
|
|
|
|
rpm -q "$1" &> /dev/null
|
|
|
|
|
}
|
|
|
|
|
if (inst "centos-stream-repos"); then
|
|
|
|
|
OS="CentOS-Stream"
|
|
|
|
|
else
|
|
|
|
|
OS="CentOs"
|
|
|
|
|
fi
|
2024-06-04 19:39:55 +02:00
|
|
|
VERFULL="$(sed 's/^.*release //;s/ (Fin.*$//' /etc/centos-release)"
|
|
|
|
|
VER="${VERFULL:0:1}" # return 6, 7 or 8
|
2023-10-16 22:24:49 +02:00
|
|
|
elif [ -f /etc/fedora-release ]; then
|
|
|
|
|
inst() {
|
|
|
|
|
rpm -q "$1" &> /dev/null
|
|
|
|
|
}
|
|
|
|
|
OS="Fedora"
|
2024-06-04 19:39:55 +02:00
|
|
|
VERFULL="$(sed 's/^.*release //;s/ (Fin.*$//' /etc/fedora-release)"
|
|
|
|
|
VER="${VERFULL:0:2}" # return 34, 35 or 36
|
2023-10-16 22:24:49 +02:00
|
|
|
elif [ -f /etc/lsb-release ]; then
|
2024-06-04 19:39:55 +02:00
|
|
|
OS="$(grep DISTRIB_ID /etc/lsb-release | sed 's/^.*=//')"
|
|
|
|
|
VER="$(grep DISTRIB_RELEASE /etc/lsb-release | sed 's/^.*=//')"
|
2023-10-16 22:24:49 +02:00
|
|
|
elif [ -f /etc/os-release ]; then
|
2024-06-04 19:39:55 +02:00
|
|
|
OS="$(grep -w ID /etc/os-release | sed 's/^.*=//')"
|
|
|
|
|
VER="$(grep -w VERSION_ID /etc/os-release | sed 's/^.*=//')"
|
2023-10-16 22:24:49 +02:00
|
|
|
else
|
2024-06-04 19:39:55 +02:00
|
|
|
OS="$(uname -s)"
|
|
|
|
|
VER="$(uname -r)"
|
2023-10-16 22:24:49 +02:00
|
|
|
fi
|
|
|
|
|
ARCH=$(uname -m)
|
2024-06-04 19:39:55 +02:00
|
|
|
echo 'Detected : "$OS" "$VER" "$ARCH"'
|
2024-06-04 19:45:05 +02:00
|
|
|
if [[ "$OS" = "Ubuntu" && ( "$VER" = "20.04" || "$VER" = "22.04" || "$VER" = "24.04" ) && "$ARCH" == "x86_64" ]] ; then
|
2024-06-04 19:37:03 +02:00
|
|
|
echo "Ok."
|
|
|
|
|
else
|
|
|
|
|
echo "Sorry, this OS is not supported by Xtream UI use online Ubuntu LTS Version."
|
2024-06-04 19:45:05 +02:00
|
|
|
echo "Use online actual Ubuntu LTS Version 20.04 22.04 or 24.04."
|
2024-06-04 19:37:03 +02:00
|
|
|
exit 1
|
|
|
|
|
fi
|
2023-10-18 20:20:22 +02:00
|
|
|
if [ -f "/usr/bin/apt-get" ]; then
|
2023-10-18 20:21:37 +02:00
|
|
|
apt-get update
|
|
|
|
|
apt-get -y dist-upgrade
|
2023-10-18 19:53:21 +02:00
|
|
|
apt-get -y install python python-dev unzip
|
|
|
|
|
apt-get -y install python2 python2-dev unzip
|
2023-10-25 16:36:16 +02:00
|
|
|
apt-get -y install python2.7 python2.7-dev unzip
|
2023-10-18 19:53:21 +02:00
|
|
|
apt-get -y install python2.8 python2.8-dev unzip
|
|
|
|
|
apt-get -y install python3 python3-dev unzip
|
2023-10-18 20:21:37 +02:00
|
|
|
elif [ -f "/usr/bin/dnf" ]; then
|
|
|
|
|
dnf -y update
|
|
|
|
|
dnf -y install python python-devel unzip
|
|
|
|
|
dnf -y install python2 python2-devel unzip
|
2023-10-25 16:36:16 +02:00
|
|
|
dnf -y install python2.7 python2.7-devel unzip
|
2023-10-18 20:21:37 +02:00
|
|
|
dnf -y install python2.8 python2.8-devel unzip
|
|
|
|
|
dnf -y install python3 python3-devel unzip
|
|
|
|
|
elif [ -f "/usr/bin/yum" ]; then
|
|
|
|
|
yum -y update
|
2023-10-18 19:53:21 +02:00
|
|
|
yum -y install python python-devel unzip
|
|
|
|
|
yum -y install python2 python2-devel unzip
|
2023-10-25 16:36:16 +02:00
|
|
|
yum -y install python2.7 python2.7-devel unzip
|
2023-10-18 19:53:21 +02:00
|
|
|
yum -y install python2.8 python2.8-devel unzip
|
|
|
|
|
yum -y install python3 python3-devel unzip
|
|
|
|
|
fi
|
2023-10-19 06:25:49 +02:00
|
|
|
cd /root
|
2023-10-18 19:53:21 +02:00
|
|
|
wget https://github.com/amidevous/xui.one/releases/download/test/XUI_1.5.12.zip -O XUI_1.5.12.zip
|
|
|
|
|
unzip XUI_1.5.12.zip
|
2023-10-19 06:25:49 +02:00
|
|
|
wget https://raw.githubusercontent.com/amidevous/xui.one/master/install.python3 -O /root/install.python3
|
2023-10-19 06:29:28 +02:00
|
|
|
python3 /root/install.python3
|
2023-10-16 22:24:49 +02:00
|
|
|
echo "finish"
|
|
|
|
|
|