From 341d24894ef9288d2763e22d9a80d2786840ea22 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Mon, 28 Mar 2022 16:55:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E9=80=9A=E8=BF=87IP=E8=AE=BF=E9=97=AE80?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E3=80=81=E5=8D=B8=E8=BD=BD=E6=97=B6=E5=88=A0?= =?UTF-8?q?=E9=99=A4nginx=E4=BC=AA=E8=A3=85=E7=BD=91=E7=AB=99=E3=80=8180?= =?UTF-8?q?=E9=87=8D=E5=AE=9A=E5=90=91=E4=BF=AE=E6=94=B9=E4=B8=BA302?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/install.sh b/install.sh index 1a1c3db..ae7f155 100644 --- a/install.sh +++ b/install.sh @@ -808,17 +808,21 @@ EOF else cat <${nginxConfigPath}alone.conf + server { + listen 80; + server_name _; + return 403; + } + server { + listen 127.0.0.1:31300; + server_name _; + return 403; + } server { listen 80; listen [::]:80; server_name ${domain}; - # shellcheck disable=SC2154 - return 301 https://${domain}\${request_uri}; - } - server { - listen 127.0.0.1:31300; - server_name _; - return 403; + return 302 https://${domain}\${request_uri}; } EOF fi @@ -1645,7 +1649,8 @@ getClients() { if [[ ${addClientsStatus} == "true" ]]; then if [[ ! -f "${path}" ]]; then echo - local protocol=$(echo "${path}" | awk -F "[_]" '{print $2 $3}') + local protocol + protocol=$(echo "${path}" | awk -F "[_]" '{print $2 $3}') echoContent yellow "没有读取到此协议[${protocol}]上一次安装的配置文件,采用配置文件的第一个uuid" else previousClients=$(jq -r ".inbounds[0].settings.clients" "${path}") @@ -2872,6 +2877,12 @@ unInstall() { rm -rf /etc/v2ray-agent rm -rf ${nginxConfigPath}alone.conf + + if [[ -d "/usr/share/nginx/html" && -f "/usr/share/nginx/html/check" ]]; then + rm -rf /usr/share/nginx/html + echoContent green " ---> 删除伪装网站完成" + fi + rm -rf /usr/bin/vasma rm -rf /usr/sbin/vasma echoContent green " ---> 卸载快捷方式完成" @@ -2977,7 +2988,7 @@ customUserEmail() { if [[ -z "${currentCustomEmail}" ]]; then currentCustomEmail="${currentHost}_${currentCustomUUID}" echoContent yellow "email: ${currentCustomEmail}\n" -# echoContent red " ---> email不可为空" + # echoContent red " ---> email不可为空" else jq -r -c '.inbounds[0].settings.clients[].email' ${configPath}${frontingType}.json | while read -r line; do if [[ "${line}" == "${currentCustomEmail}" ]]; then @@ -4410,7 +4421,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.5.55" + echoContent green "当前版本:v2.5.56" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus