From f41fa986a93dc3e08c9c9c6122ec37ed146a666c Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Wed, 24 Nov 2021 13:51:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=97=B6=E7=9A=84tls=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E3=80=81=E4=BC=98=E5=8C=96=E6=B7=BB=E5=8A=A0=E8=B4=A6=E6=88=B7?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E5=86=8D=E8=B7=B3=E8=BD=AC=E5=88=B0=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E8=B4=A6=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 9038759..523368c 100644 --- a/install.sh +++ b/install.sh @@ -1130,9 +1130,13 @@ renewalTLS() { if [[ -n $1 ]]; then echoContent skyBlue "\n进度 $1/1 : 更新证书" fi + local domain=${currentHost} + if [[ -z "${currentHost}" && -n "${tlsDomain}" ]];then + domain=${tlsDomain} + fi - if [[ -d "$HOME/.acme.sh/${currentHost}_ecc" ]] && [[ -f "$HOME/.acme.sh/${currentHost}_ecc/${currentHost}.key" ]] && [[ -f "$HOME/.acme.sh/${currentHost}_ecc/${currentHost}.cer" ]]; then - modifyTime=$(stat "$HOME/.acme.sh/${currentHost}_ecc/${currentHost}.cer" | sed -n '7,6p' | awk '{print $2" "$3" "$4" "$5}') + if [[ -d "$HOME/.acme.sh/${domain}_ecc" ]] && [[ -f "$HOME/.acme.sh/${domain}_ecc/${domain}.key" ]] && [[ -f "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" ]]; then + modifyTime=$(stat "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" | sed -n '7,6p' | awk '{print $2" "$3" "$4" "$5}') modifyTime=$(date +%s -d "${modifyTime}") currentTime=$(date +%s) @@ -1155,7 +1159,7 @@ renewalTLS() { echoContent yellow " ---> 重新生成证书" handleNginx stop sudo "$HOME/.acme.sh/acme.sh" --cron --home "$HOME/.acme.sh" - sudo "$HOME/.acme.sh/acme.sh" --installcert -d "${currentHost}" --fullchainpath /etc/v2ray-agent/tls/"${currentHost}.crt" --keypath /etc/v2ray-agent/tls/"${currentHost}.key" --ecc + sudo "$HOME/.acme.sh/acme.sh" --installcert -d "${domain}" --fullchainpath /etc/v2ray-agent/tls/"${domain}.crt" --keypath /etc/v2ray-agent/tls/"${domain}.key" --ecc reloadCore else echoContent green " ---> 证书有效" @@ -3095,7 +3099,7 @@ addUser() { reloadCore echoContent green " ---> 添加完成" - showAccounts 1 + manageAccount 1 } # 移除用户 @@ -4301,7 +4305,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.5.39" + echoContent green "当前版本:v2.5.40" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus