forked from M4mmad/3xui-multi-protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
85 lines (79 loc) · 2.97 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
if [[ -f /etc/os-release ]]; then
source /etc/os-release
release=$ID
else
source /usr/lib/os-release
release=$ID
fi
rm -rf 3xui-multi-protocol
if [[ "${release}" == "debian" ]]; then
apt install git
git clone https://github.com/M4mmad/3xui-multi-protocol.git
cd 3xui-multi-protocol/3xui-multi-protocol
wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt-get update
apt-get install -y dotnet-sdk-7.0
apt-get install -y aspnetcore-runtime-7.0
apt-get install -y dotnet-runtime-7.0
apt install libc6
dotnet publish -c Release -o /etc/3xui-multi-protocol
elif [[ "${release}" == "centos" ]]; then
dnf install wget
dnf install git
git clone https://github.com/M4mmad/3xui-multi-protocol.git
cd 3xui-multi-protocol/3xui-multi-protocol
sudo dnf install dotnet-sdk-7.0
sudo dnf install aspnetcore-runtime-7.0
sudo dnf install dotnet-runtime-7.0
dotnet publish -c Release -o /etc/3xui-multi-protocol
elif [[ "${release}" == "fedora" ]]; then
dnf install wget
dnf install git
git clone https://github.com/M4mmad/3xui-multi-protocol.git
cd 3xui-multi-protocol/3xui-multi-protocol
sudo dnf install dotnet-sdk-7.0
sudo dnf install aspnetcore-runtime-7.0
sudo dnf install dotnet-runtime-7.0
dotnet publish -c Release -o /etc/3xui-multi-protocol
elif [[ "${release}" == "ubuntu" ]]; then
declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi)
apt install git
git clone https://github.com/M4mmad/3xui-multi-protocol.git
cd 3xui-multi-protocol/3xui-multi-protocol
wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt-get update
apt-get install -y dotnet-sdk-7.0
apt-get update
apt-get install -y aspnetcore-runtime-7.0
apt-get update
apt-get install -y dotnet-runtime-7.0
apt-get update
if [[ "${repo_version}" == "22.04" ]]; then
sudo apt-get purge dotnet-sdk-7.0
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list && sudo apt update
sudo apt install -y dotnet7
fi
dotnet publish -c Release -o /etc/3xui-multi-protocol
else
apt install git
git clone https://github.com/M4mmad/3xui-multi-protocol.git
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel 7.0
apt update
apt install -y dotnet7
cd 3xui-multi-protocol/3xui-multi-protocol
dotnet publish -c Release -o /etc/3xui-multi-protocol
fi
cd /etc/systemd/system/
wget https://raw.githubusercontent.com/M4mmad/3xui-multi-protocol/master/3xui-multi-protocol.service
cp /etc/x-ui/x-ui.db /etc/x-ui/backup.db
systemctl daemon-reload
systemctl start 3xui-multi-protocol
systemctl enable 3xui-multi-protocol
systemctl restart 3xui-multi-protocol