get full path to restored cn config file

This commit is contained in:
Asif Bacchus 2020-03-13 23:33:08 -06:00
parent d7d7f1eae1
commit b033828165

View File

@ -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'