From bec180b5343c9710fa196099911b64e1a5ebdd08 Mon Sep 17 00:00:00 2001 From: gamesme Date: Wed, 22 Nov 2023 06:00:41 +0800 Subject: [PATCH] revert 91515ee7af9ed9c36fe8c94fd0e0361288f099af revert fix file --- trojan.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/trojan.sh b/trojan.sh index ff0e962..3732992 100644 --- a/trojan.sh +++ b/trojan.sh @@ -80,7 +80,7 @@ EOF fi /root/.acme.sh/acme.sh --register-account -m myemail@example.com --server zerossl /root/.acme.sh/acme.sh --issue -d $your_domain --nginx --ecc - if [ -f "/root/.acme.sh/$your_domain_ecc/fullchain.cer" ]; then + if test -s /root/.acme.sh/$your_domain_ecc/fullchain.cer; then cert_success="1" fi elif [ -f "/usr/src/trojan-cert/$your_domain/fullchain.cer" ]; then @@ -91,7 +91,7 @@ EOF if [ $minus -gt 5184000 ]; then /root/.acme.sh/acme.sh --register-account -m myemail@example.com --server zerossl /root/.acme.sh/acme.sh --issue -d $your_domain --nginx --ecc - if [ -f "/root/.acme.sh/$your_domain_ecc/fullchain.cer" ]; then + if test -s /root/.acme.sh/$your_domain_ecc/fullchain.cer; then cert_success="1" fi else @@ -102,7 +102,7 @@ EOF mkdir /usr/src/trojan-cert/$your_domain /root/.acme.sh/acme.sh --register-account -m myemail@example.com --server zerossl /root/.acme.sh/acme.sh --issue -d $your_domain --nginx --ecc - if [ -f "/root/.acme.sh/$your_domain_ecc/fullchain.cer" ]; then + if test -s /root/.acme.sh/$your_domain_ecc/fullchain.cer; then cert_success="1" fi fi @@ -425,7 +425,7 @@ function repair_cert(){ blue "务必与之前失败使用的域名一致" green "============================" read your_domain - if [ -f "/root/.acme.sh/$your_domain_ecc/fullchain.cer" ]; then + if test -s /root/.acme.sh/$your_domain_ecc/fullchain.cer; then green "证书文件存在" exit 1 fi @@ -444,7 +444,7 @@ function repair_cert(){ --key-file /usr/src/trojan-cert/$your_domain/private.key \ --fullchain-file /usr/src/trojan-cert/$your_domain/fullchain.cer \ --reloadcmd "systemctl restart trojan" - if [ -f "/root/.acme.sh/$your_domain_ecc/fullchain.cer" ]; then + if test -s /usr/src/trojan-cert/$your_domain/fullchain.cer; then green "证书申请成功" systemctl restart trojan systemctl start nginx