1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
Asif Bacchus 8126efc7e1 fix possible double-backslash on outputLocation 2020-03-13 20:03:36 -06:00
Asif Bacchus 85b02e8821 set vars and switches for removing TLS operation 2020-03-13 20:01:50 -06:00
Asif Bacchus 0246568a6c fix possible double-backslash on outputLocation 2020-03-13 19:58:39 -06:00
1 changed files with 7 additions and 2 deletions

View File

@ -43,6 +43,7 @@ logfile="$scriptPath/${scriptName%.*}.log"
# with '.params' extension
encParams="$scriptPath/${scriptName%.*}.params"
# backup mode by default
unset removeTLS
unset backupFile
extract=false
decrypt=false
@ -322,6 +323,10 @@ while [ $# -gt 0 ]; do
encParams="$2"
shift
;;
--removeTLS)
# remove olcTLS entries from cn=config
removeTLS=true
;;
*)
printf "%s\nUnknown option: %s\n" "$err" "$1"
printf "Use '--help' for valid options.\n\n%s" "$norm"
@ -375,7 +380,7 @@ if [ -d "$outputLocation" ]; then
fi
else
# create directory
if ! mkdir -p "$outputLocation" > /dev/null 2>&1; then
if ! mkdir -p "${outputLocation%/}" > /dev/null 2>&1; then
exitError '1' "Unable to create output path: $outputLocation" 'nc'
else
logInfo "Writing output to: $outputLocation"
@ -555,7 +560,7 @@ elif [ $extract = 'false' ]; then
exitError 6 'Unable to copy backup archive from container to host.'
fi
logInfo 'done'
logInfo "Backup file: $outputLocation/ldap-${fileDate}.tar.gz"
logInfo "Backup file: ${outputLocation%/}/ldap-${fileDate}.tar.gz"
## cleanup and log success
cleanup