Compare commits
2 commits
91f4d3b3c2
...
f1b7533218
Author | SHA1 | Date | |
---|---|---|---|
|
f1b7533218 | ||
|
cfa66e1387 |
1 changed files with 10 additions and 7 deletions
17
certbotd.sh
17
certbotd.sh
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
if test -z "${NODES}" && test -z "${SINGLE_NODE}"; then
|
||||
echo "The env var NODES is empty, if you don't want to synchronize to other servers, set SINGLE_NODE=true" >&2
|
||||
echo "not ok - The env var NODES is empty, if you don't want to synchronize to other servers, set SINGLE_NODE=true" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -9,7 +9,7 @@ lock=/tmp/certbot.lck
|
|||
updated=/tmp/certbot.updated
|
||||
|
||||
ensure() {
|
||||
test -n "$1" && echo "$1 received, exiting gracefully..."
|
||||
test -n "$1" && echo "ok - $1 received, exiting gracefully..." >&2
|
||||
|
||||
rm -f "${lock}"
|
||||
|
||||
|
@ -29,7 +29,7 @@ ensure() {
|
|||
# awkward. A restricted rsync treats / as the remote location for the
|
||||
# certificates.
|
||||
for NODE in ${NODES}; do
|
||||
rsync -avHAXL --delete-after /etc/letsencrypt/live/ ${NODE}/
|
||||
rsync -avHAXL --delete-after /etc/letsencrypt/live/ ${NODE}/ || continue
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -70,8 +70,8 @@ case $1 in
|
|||
*)
|
||||
# Only one instance can run at a time
|
||||
if test -f "${lock}" ; then
|
||||
echo "There's a certbotd instance already running, doing nothing..." >&2
|
||||
echo "If the problem persists, you may need to remove ${lock} manually." >&2
|
||||
echo "not ok - There's a certbotd instance already running, doing nothing..." >&2
|
||||
echo "not ok - If the problem persists, you may need to remove ${lock} manually." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -92,11 +92,14 @@ case $1 in
|
|||
| jq --raw-output .[] \
|
||||
| while read domain; do
|
||||
# Skip already existing domains
|
||||
test -d "/etc/letsencrypt/live/${domain}" && continue
|
||||
if test -d "/etc/letsencrypt/renewal/${domain}.conf"
|
||||
echo "ok - ${domain} already issued" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
# Ignore non local domains
|
||||
if ! nslookup "${domain}" 8.8.8.8 | grep -qE "(${SUTTY_ADDRESSES// /|})" ; then
|
||||
echo "${domain} is not configured to any Sutty node or DNS records are still cached, ignoring for now"
|
||||
echo "ok - ${domain} is not configured to any Sutty node or DNS records are still cached, ignoring for now # skip" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue