From e8b18499389f6f25ad6615ddcec0d63089012249 Mon Sep 17 00:00:00 2001 From: mack-a <57424792+mack-a@users.noreply.github.com> Date: Wed, 26 May 2021 15:01:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=84=9A=E6=9C=AC):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E8=AF=81=E4=B9=A6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=97=A5=E5=BF=97=E3=80=81=E6=B7=BB=E5=8A=A0=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=AE=A1=E7=90=86=E5=8F=AF=E6=9F=A5=E7=9C=8B=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index cda8c4b..c990155 100644 --- a/install.sh +++ b/install.sh @@ -784,7 +784,7 @@ installCronTLS() { echoContent skyBlue "\n进度 $1/${totalProgress} : 添加定时维护证书" crontab -l >/etc/v2ray-agent/backup_crontab.cron sed '/v2ray-agent/d;/acme.sh/d' /etc/v2ray-agent/backup_crontab.cron >/etc/v2ray-agent/backup_crontab.cron - echo "30 1 * * * /bin/bash /etc/v2ray-agent/install.sh RenewTLS" >>/etc/v2ray-agent/backup_crontab.cron + echo "30 1 * * * /bin/bash /etc/v2ray-agent/install.sh RenewTLS >> /etc/v2ray-agent/crontab_tls.log 2>&1" >>/etc/v2ray-agent/backup_crontab.cron crontab /etc/v2ray-agent/backup_crontab.cron echoContent green "\n ---> 添加定时维护证书成功" } @@ -805,15 +805,18 @@ renewalTLS() { if [[ ${remainingDays} -le 0 ]]; then tlsStatus="已过期" fi + + echoContent skyBlue " ---> 证书检查日期:$(date "+%F %H:%M:%S")" echoContent skyBlue " ---> 证书生成日期:$(date -d @"${modifyTime}" +"%F %H:%M:%S")" echoContent skyBlue " ---> 证书生成天数:${days}" echoContent skyBlue " ---> 证书剩余天数:"${tlsStatus} + echoContent skyBlue " ---> 证书过期前最后一天自动更新,如更新失败请手动更新" if [[ ${remainingDays} -le 1 ]]; then 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 tee -a /etc/v2ray-agent/tls/acme.log + sudo "$HOME/.acme.sh/acme.sh" --installcert -d "${currentHost}" --fullchainpath /etc/v2ray-agent/tls/"${currentHost}.crt" --keypath /etc/v2ray-agent/tls/"${currentHost}.key" --ecc handleNginx start reloadCore @@ -1460,7 +1463,6 @@ initV2RayConfig() { fi if [[ -n "${currentUUID}" && -z "${uuid}" ]]; then - echo read -r -p "读取到上次安装记录,是否使用上次安装时的UUID ?[y/n]:" historyUUIDStatus if [[ "${historyUUIDStatus}" == "y" ]]; then uuid=${currentUUID} @@ -1790,7 +1792,6 @@ initXrayConfig() { fi if [[ -n "${currentUUID}" && -z "${uuid}" ]]; then - echo read -r -p "读取到上次安装记录,是否使用上次安装时的UUID ?[y/n]:" historyUUIDStatus if [[ "${historyUUIDStatus}" == "y" ]]; then uuid=${currentUUID} @@ -2859,7 +2860,8 @@ checkLog() { echoContent yellow "2.监听access日志" echoContent yellow "3.监听error日志" - echoContent yellow "4.清空日志" + echoContent yellow "4.查看证书更新日志" + echoContent yellow "5.清空日志" echoContent red "==============================================================" read -r -p "请选择:" selectAccessLogType @@ -2897,6 +2899,9 @@ EOF tail -f ${configPathLog}error.log ;; 4) + tail -n 100 /etc/v2ray-agent/crontab_tls.log + ;; + 5) echo >${configPathLog}access.log echo >${configPathLog}error.log ;; @@ -3773,7 +3778,7 @@ menu() { cd "$HOME" || exit echoContent red "\n==============================================================" echoContent green "作者:mack-a" - echoContent green "当前版本:v2.4.25" + echoContent green "当前版本:v2.4.26" echoContent green "Github:https://github.com/mack-a/v2ray-agent" echoContent green "描述:八合一共存脚本\c" showInstallStatus