From cf8efbfecd514420e16e4a5dcf0230537e877d60 Mon Sep 17 00:00:00 2001 From: wulabing Date: Mon, 10 Dec 2018 19:19:40 +0800 Subject: [PATCH] Update install.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复证书无法自动更新的bug --- install.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 162bc1c..078ea13 100644 --- a/install.sh +++ b/install.sh @@ -326,6 +326,16 @@ start_process_systemd(){ judge "V2ray 启动" } +acme_cron_update(){ + if [[ "${ID}" == "centos" ]];then + sed -i "/acme.sh/c 0 0 * * 0 systemctl stop nginx && \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ + > /dev/null && systemctl start nginx " /var/spool/cron/root + else + sed -i "/acme.sh/c 0 0 * * 0 systemctl stop nginx && \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ + > /dev/null && systemctl start nginx " /var/spool/cron/crontabs/root + fi + judge "cron 计划任务更新" +} show_information(){ clear @@ -367,9 +377,10 @@ main(){ #将证书生成放在最后,尽量避免多次尝试脚本从而造成的多次证书申请 ssl_install acme - + show_information start_process_systemd + acme_cron_update } main