From 69bdef8b5a093631bdb7cc1d614aac250ae4dd53 Mon Sep 17 00:00:00 2001 From: Mingtian Yang Date: Sun, 29 Oct 2023 22:24:11 +0800 Subject: [PATCH] update bash --- docker.d/entrypoint.sh | 16 ++-------------- docker.d/main.sh | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/docker.d/entrypoint.sh b/docker.d/entrypoint.sh index 41b48c4f..bee7fbc8 100755 --- a/docker.d/entrypoint.sh +++ b/docker.d/entrypoint.sh @@ -2,25 +2,13 @@ DOMAIN_NAME=$DOMAIN_NAME MAIL=$EMAIL -echo "start to renew cert from dnspod" - -if [ -z "$DNS_DNSPOD_API_ID" ]; then - echo "DNS_DNSPOD_API_ID is not set" - exit 1 -elif [ -z "$DNS_DNSPOD_API_TOKEN"]; then - echo "DNS_DNSPOD_API_TOKEN is not set" - exit 1 -fi +echo "start to renew cert from dnspod" # create credentials.ini in /tmp directory echo "dnsDnspodApiId = $DNS_DNSPOD_API_ID" > /tmp/credentials.ini echo "dnsDnspodApiToken = $DNS_DNSPOD_API_TOKEN" >> /tmp/credentials.ini -certbot certonly --agree-tos \ ---dns-dnspod \ ---dns-dnspod-credentials /tmp/credentials.ini \ ---dns-dnspod-propagation-seconds 30 \ --d ${DOMAIN_NAME} -m ${MAIL} --no-eff-email --config-dir /tmp --work-dir /tmp --logs-dir /tmp +certbot certonly --agree-tos -a dns-dnspod --dns-dnspod-credentials /tmp/credentials.ini --dns-dnspod-propagation-seconds 30 -d ${DOMAIN_NAME} -m ${MAIL} --no-eff-email --config-dir /tmp --work-dir /tmp --logs-dir /tmp sleep 30 TODAY=$(date +"%Y-%m-%d") diff --git a/docker.d/main.sh b/docker.d/main.sh index 41b48c4f..bee7fbc8 100755 --- a/docker.d/main.sh +++ b/docker.d/main.sh @@ -2,25 +2,13 @@ DOMAIN_NAME=$DOMAIN_NAME MAIL=$EMAIL -echo "start to renew cert from dnspod" - -if [ -z "$DNS_DNSPOD_API_ID" ]; then - echo "DNS_DNSPOD_API_ID is not set" - exit 1 -elif [ -z "$DNS_DNSPOD_API_TOKEN"]; then - echo "DNS_DNSPOD_API_TOKEN is not set" - exit 1 -fi +echo "start to renew cert from dnspod" # create credentials.ini in /tmp directory echo "dnsDnspodApiId = $DNS_DNSPOD_API_ID" > /tmp/credentials.ini echo "dnsDnspodApiToken = $DNS_DNSPOD_API_TOKEN" >> /tmp/credentials.ini -certbot certonly --agree-tos \ ---dns-dnspod \ ---dns-dnspod-credentials /tmp/credentials.ini \ ---dns-dnspod-propagation-seconds 30 \ --d ${DOMAIN_NAME} -m ${MAIL} --no-eff-email --config-dir /tmp --work-dir /tmp --logs-dir /tmp +certbot certonly --agree-tos -a dns-dnspod --dns-dnspod-credentials /tmp/credentials.ini --dns-dnspod-propagation-seconds 30 -d ${DOMAIN_NAME} -m ${MAIL} --no-eff-email --config-dir /tmp --work-dir /tmp --logs-dir /tmp sleep 30 TODAY=$(date +"%Y-%m-%d")