From 46a81e2feb162f319d1dc41db9cb99413f49bfb8 Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Thu, 9 Feb 2017 20:58:17 +0100 Subject: [PATCH] Always use path to LECONFIGDIR from variable Replace all hardcoded occurences of letsencrypt config dir path with variable to reduce possibility of future mistakes. --- letsencrypt-renew.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/letsencrypt-renew.sh b/letsencrypt-renew.sh index 79725f5..6c58d0e 100755 --- a/letsencrypt-renew.sh +++ b/letsencrypt-renew.sh @@ -13,13 +13,13 @@ for inifile in "${LECONFIGDIR}/cli-*.ini"; do sleep $(expr $RANDOM % 600) # Check validity of cert for domain - openssl x509 -checkend $(( 21 * 86400 )) -in ~/.config/letsencrypt/live/${domain}/cert.pem > /dev/null + openssl x509 -checkend $(( 21 * 86400 )) -in "${LECONFIGDIR}/live/${domain}/cert.pem" > /dev/null if [ \$? != 0 ]; then # run let's encrypt - letsencrypt certonly -c ~/.config/letsencrypt/cli-${domain}.ini + letsencrypt certonly -c "${LECONFIGDIR}/letsencrypt/cli-${domain}.ini" # import certificate - uberspace-add-certificate -k ~/.config/letsencrypt/live/${domain}/privkey.pem -c ~/.config/letsencrypt/live/${domain}/cert.pem + uberspace-add-certificate -k "${LECONFIGDIR}/live/${domain}/privkey.pem" -c "${LECONFIGDIR}/live/${domain}/cert.pem" fi done