From b033828165f9773014a6c9824d1855213bb63df9 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 13 Mar 2020 23:33:08 -0600 Subject: [PATCH] get full path to restored cn config file --- ab-openldap/backup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ab-openldap/backup.sh b/ab-openldap/backup.sh index 4d6fb15..d974b67 100755 --- a/ab-openldap/backup.sh +++ b/ab-openldap/backup.sh @@ -467,12 +467,12 @@ if [ $extract = 'true' ]; then # remove TLS configuration if [ "$removeTLS" = 'true' ]; then # get newest config-? file in outputLocation/restore directory - cnConfigFile=$( ls "${outputLocation%/}/restore" -t | head -n1 ) + cnConfigFile=$( ls -Adt ${outputLocation%/}/restore/config-* | head -n1 ) # remove TLS configuration entries - logInfo 'task' "Removing TLS configuration $cnConfigFile... " - sed -i -e '/^olcTLS/d' "$cnConfigFile" + logInfo 'task' "Removing TLS configuration from '$cnConfigFile'" + sed -i -e '/^olcTLS/d' "$cnConfigFile" 2>> "$logfile" # check our work - if ! grep -q '^olcTLS' "$cnConfigFile"; then + if ! grep -q '^olcTLS' "$cnConfigFile" 2>> "$logfile"; then logInfo 'done' else logInfo 'err'