From e6a0da5c0052f7c41695c6b9141b53b1a83086b2 Mon Sep 17 00:00:00 2001 From: Jonathan Golder Date: Thu, 9 Feb 2017 21:04:07 +0100 Subject: [PATCH] Catch missing LECONFIGDIR Threw error if the config dir is not already existing. --- letsencrypt-renew.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/letsencrypt-renew.sh b/letsencrypt-renew.sh index 6c58d0e..f5a6ddc 100755 --- a/letsencrypt-renew.sh +++ b/letsencrypt-renew.sh @@ -1,8 +1,15 @@ #!/bin/bash PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin +# PATH to inifiles / letsencrypt dir LECONFIGDIR="~/.config/letsencrypt" +# Catch missing LECONFIGDIR +if [ ! -d "${LECONFIGDIR}" ]; then + echo "$0: ${LECONFIGDIR} does not exists! Maybe letsencrypt is not yet initialised!" >&2 + exit 1 +fi + # Get all existing inifiles matching namescheme cli-${domain}.ini for inifile in "${LECONFIGDIR}/cli-*.ini"; do