Browse Source

Catch missing LECONFIGDIR

Threw error if the config dir is not already existing.
Jonathan Golder 2 years ago
parent
commit
e6a0da5c00
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      letsencrypt-renew.sh

+ 7
- 0
letsencrypt-renew.sh View File

@@ -1,8 +1,15 @@
1 1
 #!/bin/bash
2 2
 PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
3 3
 
4
+# PATH to inifiles / letsencrypt dir
4 5
 LECONFIGDIR="~/.config/letsencrypt"
5 6
 
7
+# Catch missing LECONFIGDIR
8
+if [ ! -d "${LECONFIGDIR}" ]; then
9
+	echo "$0: ${LECONFIGDIR} does not exists! Maybe letsencrypt is not yet initialised!" >&2
10
+	exit 1
11
+fi
12
+
6 13
 # Get all existing inifiles matching namescheme cli-${domain}.ini
7 14
 for inifile in "${LECONFIGDIR}/cli-*.ini"; do
8 15