diff --git a/src/med_integrity b/src/med_integrity index 27a4c66..f14edcd 100644 --- a/src/med_integrity +++ b/src/med_integrity @@ -13,12 +13,14 @@ # } med_integrity() { - local FILE="${1}" + local fileList=(${@}) for file in ${fileList[@]}; do flac -wst "${file}" >${STDERR} 2>&1 - local EXIT=$? [[ $? -eq 0 ]] || { echo "[>>>>>>] Error reported"; cat ${STDERR}; local ERR=true; } done + echo >${STDERR} [[ "${ERR}" == "true" ]] && { _msg EXEC "Integrity check completed with errors"; _msg WARN; return 1; } || { _msg EXEC "Integrity check completed succesfully"; _msg OK; return 0; } } + +