From 090bd040252128646a63e7b7ff91b41efada84e0 Mon Sep 17 00:00:00 2001 From: wulabing <91d$5gKrmVShheJf> Date: Thu, 4 Jun 2020 14:59:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=A4=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0cron=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index f57bc89..8fe0d23 100644 --- a/install.sh +++ b/install.sh @@ -616,14 +616,16 @@ nginx_process_disabled() { #} acme_cron_update() { wget -N -P /usr/bin --no-check-certificate "https://raw.githubusercontent.com/wulabing/V2Ray_ws-tls_bash_onekey/dev/ssl_update.sh" - if [[ "${ID}" == "centos" ]]; then - # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ - # &> /dev/null" /var/spool/cron/root - sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" /var/spool/cron/root - else - # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ - # &> /dev/null" /var/spool/cron/crontabs/root - sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" /var/spool/cron/crontabs/root + if [[ $(crontab -l | grep -c "ssl_update.sh") -lt 1 ]]; then + if [[ "${ID}" == "centos" ]]; then + # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ + # &> /dev/null" /var/spool/cron/root + sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" /var/spool/cron/root + else + # sed -i "/acme.sh/c 0 3 * * 0 \"/root/.acme.sh\"/acme.sh --cron --home \"/root/.acme.sh\" \ + # &> /dev/null" /var/spool/cron/crontabs/root + sed -i "/acme.sh/c 0 3 * * 0 bash ${ssl_update_file}" /var/spool/cron/crontabs/root + fi fi judge "cron 计划任务更新" }