Add comment sections, use CERT_DIR, add exit 0.
This commit is contained in:
parent
478cce43b5
commit
bf2fd2bb28
@ -1,6 +1,8 @@
|
||||
#!/bin/bash
|
||||
# Create a real 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"
|
||||
|
||||
## Validations ##
|
||||
|
||||
# Ensure that fake certs were created at some point, or that the system has been run at least once.
|
||||
if [[ ! -d $DIR/../../Volumes/ReverseProxy/letsencrypt-certs ]]; then
|
||||
if [[ ! -d $CERT_DIR ]]; then
|
||||
echo "ERROR: Certificate directory does not exist yet. Run the placeholder script first." >&2
|
||||
exit 1
|
||||
fi
|
||||
@ -23,6 +27,8 @@ if [[ $certbot_running != 1 ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## Input ##
|
||||
|
||||
# Gather information from the user.
|
||||
echo -n "Please provide the email address you would like the certs bound to: "
|
||||
read email
|
||||
@ -39,6 +45,8 @@ if [[ $confirm != "Y"* ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
## Main ##
|
||||
|
||||
# Loop over the proxy configuration files and ensure they have certs.
|
||||
ls $DIR/config/conf.d/*.* | while read file; do
|
||||
filename=`basename $file`
|
||||
@ -71,3 +79,5 @@ ls $DIR/config/conf.d/*.* | while read file; do
|
||||
continue
|
||||
fi
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user