Add comment sections, use CERT_DIR, add exit 0.

This commit is contained in:
2023-07-08 08:18:14 -07:00
parent 478cce43b5
commit bf2fd2bb28
2 changed files with 18 additions and 2 deletions

View File

@ -1,6 +1,8 @@
#!/bin/bash
# Create a fake cert for each file in config/conf.d/.
## Variables ##
DIR=`dirname $0`
if [[ $DIR == \.* ]]; then
DIR=`pwd`
@ -10,8 +12,10 @@ fi
CERT_DIR=$DIR/../../Volumes/ReverseProxy/letsencrypt-certs
echo "CERT_DIR=$CERT_DIR"
## Main ##
# Create the directory if it does not exist.
mkdir -pv $DIR/../../Volumes/ReverseProxy/letsencrypt-certs
mkdir -pv $CERT_DIR
# Loop over the proxy configuration files and ensure they have certs.
ls $DIR/config/conf.d/*.* | while read file; do
@ -29,3 +33,5 @@ ls $DIR/config/conf.d/*.* | while read file; do
echo "Certs already exist!"
fi
done
exit 0