dynamically change params filename to match script

This commit is contained in:
Asif Bacchus 2020-09-14 15:55:29 -06:00
parent 3c4b743ee3
commit 05775ea3c7

View File

@ -66,7 +66,7 @@ scriptHelp () {
printf "\n"
textblock "${bold}Usage: $scriptName [parameters]${norm}"
printf "\n"
textblock "This is a simple helper script so you can avoid lengthy typing when working with the openLDAP container. The script reads the contents of 'ab-openldap.params' and constructs various 'docker run' commands based on that file. The biggest timesaver is working with certificates. If they are specified in the '.params' file, the script will automatically bind-mount them so openLDAP starts in 'TLS required' mode."
textblock "This is a simple helper script so you can avoid lengthy typing when working with the openLDAP container. The script reads the contents of '${scriptName%.*}.params' and constructs various 'docker run' commands based on that file. The biggest timesaver is working with certificates. If they are specified in the '.params' file, the script will automatically bind-mount them so openLDAP starts in 'TLS required' mode."
printf "\n"
textblock "If you run the script with no parameters, it will execute the container 'normally': Run in detached mode with openLDAP automatically launched and logging to stdout. If you specified certificates, openLDAP will require a TLS connection. All modes of operation allow you to enter the container and connect directly using UNIX sockets also."
printf "\n"
@ -117,13 +117,13 @@ if [ ! "$( id -u )" -eq 0 ]; then
fi
# does the params file exist?
if [ ! -f "./ab-openldap.params" ]; then
consoleError '3' "Cannot find 'ab-openldap.params' file in the same directory as this script."
if [ ! -f "${scriptName%.*}.params" ]; then
consoleError '3' "Cannot find '${scriptName%.*}.params' file in the same directory as this script."
exit 3
fi
# read .params file
. ./ab-openldap.params
. ./${scriptName%.*}.params
# process startup parameters
while [ $# -gt 0 ]; do