From af60745cdca35d900fa2809122b4b3693fd42c0f Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Wed, 1 Feb 2023 17:06:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E4=BC=98=E5=8C=96d?= =?UTF-8?q?ns=E7=94=B3=E8=AF=B7=E8=AF=81=E4=B9=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index de1e3a4..1940800 100644 --- a/install.sh +++ b/install.sh @@ -1222,11 +1222,15 @@ acmeInstallSSL() { read -r -p "是否添加完成[y/n]:" addDNSTXTRecordStatus if [[ "${addDNSTXTRecordStatus}" == "y" ]]; then local txtAnswer= - txtAnswer=$(dig +nocmd "_acme-challenge.${dnsTLSDomain}" txt +noall +answer | awk -F "[\"]" '{print $2}') + txtAnswer=$(dig @1.1.1.1 +nocmd "_acme-challenge.${dnsTLSDomain}" txt +noall +answer | awk -F "[\"]" '{print $2}') if echo "${txtAnswer}" | grep -q "^${txtValue}"; then echoContent green " ---> TXT记录验证通过" echoContent green " ---> 生成证书中" - sudo "$HOME/.acme.sh/acme.sh" --renew -d "*.${dnsTLSDomain}" -d "${dnsTLSDomain}" --yes-I-know-dns-manual-mode-enough-go-ahead-please --ecc --server "${sslType}" ${installSSLIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null + if [[ -n "${installSSLIPv6}" ]]; then + sudo "$HOME/.acme.sh/acme.sh" --renew -d "*.${dnsTLSDomain}" -d "${dnsTLSDomain}" --yes-I-know-dns-manual-mode-enough-go-ahead-please --ecc --server "${sslType}" ${installSSLIPv6} 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null + else + sudo "$HOME/.acme.sh/acme.sh" --renew -d "*.${dnsTLSDomain}" -d "${dnsTLSDomain}" --yes-I-know-dns-manual-mode-enough-go-ahead-please --ecc --server "${sslType}" 2>&1 | tee -a /etc/v2ray-agent/tls/acme.log >/dev/null + fi else echoContent red " ---> 验证失败,请等待1-2分钟后重新尝试" acmeInstallSSL @@ -1335,9 +1339,12 @@ installTLS() { installTLSCount=1 echo - echoContent red " ---> TLS安装失败,正在检查80、443端口是否开放" - allowPort 80 - allowPort 443 + if [[ -z "${customPort}" ]]; then + echoContent red " ---> TLS安装失败,正在检查80、443端口是否开放" + allowPort 80 + allowPort 443 + fi + echoContent yellow " ---> 重新尝试安装TLS证书" if tail -n 10 /etc/v2ray-agent/tls/acme.log | grep -q "Could not validate email address as valid"; then @@ -5434,7 +5441,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.6.22" + echoContent green "当前版本:v2.6.23" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus