diff --git a/root/scripts/backup.sh b/root/scripts/backup.sh index 202c28e..019f341 100644 --- a/root/scripts/backup.sh +++ b/root/scripts/backup.sh @@ -105,11 +105,14 @@ function scriptHelp { function quit { # list generated warnings, if any if [ ${#exitWarn[@]} -gt 0 ]; then - echo -e "${warn}${scriptName} generated the following warnings:" \ + echo -e "\n${warn}${scriptName} generated the following warnings:" \ "${normal}" >> "$logFile" for warnCode in "${exitWarn[@]}"; do - echo -e "${warn}-- [WARNING] ${warningExplain[$warnCode]}" \ - "(code: ${warnCode}) --${normal}" >> "$logFile" + warnStamp="${warnCode%%_*}" + warnValue="${warnCode##*_}" + echo -e "${warn}${warnStamp} -- [WARNING]" \ + "${warningExplain[$warnValue]} (code: ${warnValue}) --" \ + "${normal}" >> "$logFile" done fi if [ -z "${exitError}" ]; then @@ -119,11 +122,13 @@ function quit { exit 0 else # list generated errors and explanations then exit script with code 2 - echo -e "${err}${scriptName} generated the following errors:" \ + echo -e "\n${err}${scriptName} generated the following errors:" \ "${normal}" >> "$logFile" for errCode in "${exitError[@]}"; do - echo -e "${err}-- [ERROR] ${errorExplain[$errCode]}" \ - "(code: ${errCode}) --$normal" >> "$logFile" + errStamp="${errCode%%_*}" + errValue="${errCode##*_}" + echo -e "${err}${errStamp} -- [ERROR] ${errorExplain[$errValue]}" \ + "(code: ${errValue}) --${normal}" >> "$logFile" done exit 2 fi