cleanup script spacing and bump version number
This commit is contained in:
parent
4298c0c0c6
commit
15130b87ba
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#
|
#
|
||||||
### start openldap container using params file variables
|
### start openldap container using params file variables
|
||||||
# version 3.0
|
# version 3.1
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
@ -192,10 +192,8 @@ done
|
|||||||
|
|
||||||
### process main operations
|
### process main operations
|
||||||
|
|
||||||
# automatically restore backups using a temporary container to create necessary
|
|
||||||
# volumes
|
|
||||||
if [ $restore = true ]; then
|
if [ $restore = true ]; then
|
||||||
# restore backup
|
# automatically restore backups using a temp container to create volumes
|
||||||
printf "%s\n*** Restoring Backup ***\n\n%s" "$magenta" "$norm"
|
printf "%s\n*** Restoring Backup ***\n\n%s" "$magenta" "$norm"
|
||||||
printf "To avoid errors due to existing files, this script will delete any volumes that have the following names (based on --data and --ldif):\n"
|
printf "To avoid errors due to existing files, this script will delete any volumes that have the following names (based on --data and --ldif):\n"
|
||||||
printf "\t%s\n\t%s\n" "$volume_data" "$volume_ldif"
|
printf "\t%s\n\t%s\n" "$volume_data" "$volume_ldif"
|
||||||
@ -204,6 +202,7 @@ if [ $restore = true ]; then
|
|||||||
# delete any conflicting volumes
|
# delete any conflicting volumes
|
||||||
docker volume rm -f ${volume_data} > /dev/null 2>&1
|
docker volume rm -f ${volume_data} > /dev/null 2>&1
|
||||||
docker volume rm -f ${volume_ldif} > /dev/null 2>&1
|
docker volume rm -f ${volume_ldif} > /dev/null 2>&1
|
||||||
|
|
||||||
# run temporary container to merge backup data into volumes
|
# run temporary container to merge backup data into volumes
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v "$volume_data":/var/openldap/data \
|
-v "$volume_data":/var/openldap/data \
|
||||||
@ -212,8 +211,9 @@ if [ $restore = true ]; then
|
|||||||
docker.asifbacchus.app/ldap/ab-openldap:${tag} \
|
docker.asifbacchus.app/ldap/ab-openldap:${tag} \
|
||||||
cat /var/openldap/data/restore.log
|
cat /var/openldap/data/restore.log
|
||||||
printf "\nPlease review the log output on your screen to determine if the restore was successful or what errors need to be corrected. If everything was successful, your data volumes can be used in a new container started normally.\n"
|
printf "\nPlease review the log output on your screen to determine if the restore was successful or what errors need to be corrected. If everything was successful, your data volumes can be used in a new container started normally.\n"
|
||||||
# run without TLS
|
|
||||||
elif [ -z "$TLS_CERT" ]; then
|
elif [ -z "$TLS_CERT" ]; then
|
||||||
|
# run container without TLS
|
||||||
if [ $shell = true ]; then
|
if [ $shell = true ]; then
|
||||||
# exec shell
|
# exec shell
|
||||||
printf "%s\nRunning SHELL on %s...%s\n" \
|
printf "%s\nRunning SHELL on %s...%s\n" \
|
||||||
@ -279,8 +279,9 @@ elif [ -z "$TLS_CERT" ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# run with TLS
|
|
||||||
elif [ "$TLS_CERT" ] && [ "$TLS_KEY" ] && [ "$TLS_CHAIN" ]; then
|
elif [ "$TLS_CERT" ] && [ "$TLS_KEY" ] && [ "$TLS_CHAIN" ]; then
|
||||||
|
# run container with TLS
|
||||||
# verify certificate files exist
|
# verify certificate files exist
|
||||||
if [ "$TLS_CERT" ]; then
|
if [ "$TLS_CERT" ]; then
|
||||||
if [ ! -f "$TLS_CERT" ]; then
|
if [ ! -f "$TLS_CERT" ]; then
|
||||||
@ -293,7 +294,6 @@ elif [ "$TLS_CERT" ] && [ "$TLS_KEY" ] && [ "$TLS_CHAIN" ]; then
|
|||||||
consoleError '5' 'Cannot find specified TLS certificate chain file.'
|
consoleError '5' 'Cannot find specified TLS certificate chain file.'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $shell = true ]; then
|
if [ $shell = true ]; then
|
||||||
# exec shell
|
# exec shell
|
||||||
printf "%s\nRunning SHELL on %s (TLS)...%s\n" \
|
printf "%s\nRunning SHELL on %s (TLS)...%s\n" \
|
||||||
|
Loading…
Reference in New Issue
Block a user