Skip to content

Commit

Permalink
update bash
Browse files Browse the repository at this point in the history
  • Loading branch information
timeswind committed Oct 29, 2023
1 parent 8635498 commit 69bdef8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
16 changes: 2 additions & 14 deletions docker.d/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
16 changes: 2 additions & 14 deletions docker.d/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 69bdef8

Please sign in to comment.