From 8126efc7e17c6f6fbe48400d3b19ba6b66dee391 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 13 Mar 2020 20:03:36 -0600 Subject: [PATCH] fix possible double-backslash on outputLocation --- ab-openldap/backup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ab-openldap/backup.sh b/ab-openldap/backup.sh index 1486b23..abc2cba 100755 --- a/ab-openldap/backup.sh +++ b/ab-openldap/backup.sh @@ -380,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" @@ -560,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