mirror of https://github.com/wulabing/Xray_onekey
Merge branch 'wulabing:nginx_forward' into nginx_forward
commit
eb6236edfb
35
install.sh
35
install.sh
|
@ -27,7 +27,7 @@ OK="${Green}[OK]${Font}"
|
|||
ERROR="${Red}[ERROR]${Font}"
|
||||
|
||||
# 变量
|
||||
shell_version="0.1.9"
|
||||
shell_version="0.2.0"
|
||||
github_branch="nginx_forward"
|
||||
xray_conf_dir="/usr/local/etc/xray"
|
||||
website_dir="/www/xray_web/"
|
||||
|
@ -107,10 +107,15 @@ function system_check() {
|
|||
INS="apt install -y"
|
||||
# 清除可能的遗留问题
|
||||
rm -f /etc/apt/sources.list.d/nginx.list
|
||||
$INS lsb-release gnupg2
|
||||
|
||||
echo "deb http://nginx.org/packages/debian $(lsb_release -cs) nginx" >/etc/apt/sources.list.d/nginx.list
|
||||
curl -fsSL https://nginx.org/keys/nginx_signing.key | apt-key add -
|
||||
# nginx 安装预处理
|
||||
$INS curl gnupg2 ca-certificates lsb-release debian-archive-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/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
|
||||
elif [[ "${ID}" == "ubuntu" && $(echo "${VERSION_ID}" | cut -d '.' -f1) -ge 18 ]]; then
|
||||
|
@ -123,10 +128,16 @@ function system_check() {
|
|||
INS="apt install -y"
|
||||
# 清除可能的遗留问题
|
||||
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
|
||||
else
|
||||
print_error "当前系统为 ${ID} ${VERSION_ID} 不在支持的系统列表内"
|
||||
|
@ -500,10 +511,10 @@ function generate_certificate() {
|
|||
function configure_web() {
|
||||
rm -rf /www/xray_web
|
||||
mkdir -p /www/xray_web
|
||||
wget -O web.tar.gz https://raw.githubusercontents.com/wulabing/Xray_onekey/main/basic/web.tar.gz
|
||||
tar xzf web.tar.gz -C /www/xray_web
|
||||
judge "站点伪装"
|
||||
rm -f web.tar.gz
|
||||
# wget -O web.tar.gz https://raw.githubusercontents.com/wulabing/Xray_onekey/main/basic/web.tar.gz
|
||||
# tar xzf web.tar.gz -C /www/xray_web
|
||||
# judge "站点伪装"
|
||||
# rm -f web.tar.gz
|
||||
}
|
||||
|
||||
function xray_uninstall() {
|
||||
|
|
Loading…
Reference in New Issue