diff --git a/optional/traefik-certdumper/run.sh b/optional/traefik-certdumper/run.sh index eeb45ac0..2880d44f 100755 --- a/optional/traefik-certdumper/run.sh +++ b/optional/traefik-certdumper/run.sh @@ -5,8 +5,10 @@ function dump() { traefik-certs-dumper file --crt-name "cert" --crt-ext ".pem" --key-name "key" --key-ext ".pem" --domain-subdir --dest /tmp/work --source /traefik/acme.json > /dev/null - if diff -q /tmp/work/${DOMAIN}/cert.pem /output/cert.pem >/dev/null && \ - diff -q /tmp/work/${DOMAIN}/key.pem /output/key.pem >/dev/null ; then + if [[ -f /tmp/work/${DOMAIN}/cert.pem && -f /tmp/work/${DOMAIN}/key.pem && -f /output/cert.pem && -f /output/key.pem ]] && \ + diff -q /tmp/work/${DOMAIN}/cert.pem /output/cert.pem >/dev/null && \ + diff -q /tmp/work/${DOMAIN}/key.pem /output/key.pem >/dev/null ; \ + then echo "$(date) Certificate and key still up to date, doing nothing" else echo "$(date) Certificate or key differ, updating"