mirror of https://github.com/wulabing/Xray_onekey
parent
27ccd24e34
commit
deddc03b03
27
install.sh
27
install.sh
|
@ -27,7 +27,7 @@ OK="${Green}[OK]${Font}"
|
||||||
ERROR="${Red}[ERROR]${Font}"
|
ERROR="${Red}[ERROR]${Font}"
|
||||||
|
|
||||||
# 变量
|
# 变量
|
||||||
shell_version="0.1.9"
|
shell_version="0.2.0"
|
||||||
github_branch="nginx_forward"
|
github_branch="nginx_forward"
|
||||||
xray_conf_dir="/usr/local/etc/xray"
|
xray_conf_dir="/usr/local/etc/xray"
|
||||||
website_dir="/www/xray_web/"
|
website_dir="/www/xray_web/"
|
||||||
|
@ -107,10 +107,15 @@ function system_check() {
|
||||||
INS="apt install -y"
|
INS="apt install -y"
|
||||||
# 清除可能的遗留问题
|
# 清除可能的遗留问题
|
||||||
rm -f /etc/apt/sources.list.d/nginx.list
|
rm -f /etc/apt/sources.list.d/nginx.list
|
||||||
$INS lsb-release gnupg2
|
# nginx 安装预处理
|
||||||
|
$INS curl gnupg2 ca-certificates lsb-release debian-archive-keyring
|
||||||
echo "deb http://nginx.org/packages/debian $(lsb_release -cs) nginx" >/etc/apt/sources.list.d/nginx.list
|
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
|
||||||
curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
|
| tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
|
||||||
|
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
|
||||||
|
http://nginx.org/packages/debian `lsb_release -cs` nginx" \
|
||||||
|
| tee /etc/apt/sources.list.d/nginx.list
|
||||||
|
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
|
||||||
|
| tee /etc/apt/preferences.d/99nginx
|
||||||
|
|
||||||
apt update
|
apt update
|
||||||
elif [[ "${ID}" == "ubuntu" && $(echo "${VERSION_ID}" | cut -d '.' -f1) -ge 18 ]]; then
|
elif [[ "${ID}" == "ubuntu" && $(echo "${VERSION_ID}" | cut -d '.' -f1) -ge 18 ]]; then
|
||||||
|
@ -123,10 +128,16 @@ function system_check() {
|
||||||
INS="apt install -y"
|
INS="apt install -y"
|
||||||
# 清除可能的遗留问题
|
# 清除可能的遗留问题
|
||||||
rm -f /etc/apt/sources.list.d/nginx.list
|
rm -f /etc/apt/sources.list.d/nginx.list
|
||||||
$INS lsb-release gnupg2
|
# nginx 安装预处理
|
||||||
|
$INS curl gnupg2 ca-certificates lsb-release ubuntu-keyring
|
||||||
|
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
|
||||||
|
| tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
|
||||||
|
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
|
||||||
|
http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" \
|
||||||
|
| tee /etc/apt/sources.list.d/nginx.list
|
||||||
|
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" \
|
||||||
|
| tee /etc/apt/preferences.d/99nginx
|
||||||
|
|
||||||
echo "deb http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" >/etc/apt/sources.list.d/nginx.list
|
|
||||||
curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
|
|
||||||
apt update
|
apt update
|
||||||
else
|
else
|
||||||
print_error "当前系统为 ${ID} ${VERSION_ID} 不在支持的系统列表内"
|
print_error "当前系统为 ${ID} ${VERSION_ID} 不在支持的系统列表内"
|
||||||
|
|
Loading…
Reference in New Issue