Xray-0.2.0

[fix] 修复部分 Debian/Ubuntu 系统安装后 nginx 无法启动的问题
pull/408/head
wulabing 2022-05-28 09:48:36 +08:00
parent 27ccd24e34
commit deddc03b03
No known key found for this signature in database
GPG Key ID: 213391AFDF73AE00
1 changed files with 19 additions and 8 deletions

View File

@ -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} 不在支持的系统列表内"