[chk_nonexistent_ids] Fixed logging handling
This commit is contained in:
parent
c3217d543a
commit
29b8f4d4af
1 changed files with 3 additions and 2 deletions
|
@ -22,14 +22,15 @@ chk_nonexistent_ids() {
|
||||||
local IMAGEID="$(cut -d"=" -f1 <<< ${row})"
|
local IMAGEID="$(cut -d"=" -f1 <<< ${row})"
|
||||||
local TRACKID="$(cut -d"=" -f2 <<< ${row})"
|
local TRACKID="$(cut -d"=" -f2 <<< ${row})"
|
||||||
local FILE="$(cut -d"=" -f3 <<< ${row})"
|
local FILE="$(cut -d"=" -f3 <<< ${row})"
|
||||||
|
local NONEXISTENT=false
|
||||||
|
|
||||||
echo "[ ${COUNT} / ${#rowList[@]} ] Checking path of ${TRACKID}"
|
echo "[ ${COUNT} / ${#rowList[@]} ] Checking path of ${TRACKID}"
|
||||||
|
|
||||||
if [[ ! -f "${TARGET}/${FILE}" ]] && [[ ${FILE} != "null" ]]; then
|
if [[ ! -f "${TARGET}/${FILE}" ]] && [[ ${FILE} != "null" ]]; then
|
||||||
gawk -i inplace -v imageid=${IMAGEID} -v trackid=${TRACKID} 'BEGIN{FS="\t";OFS="\t"}{if($2==imageid && $3==trackid){$4="null"}{print $0}}' ${DB_FILE}
|
gawk -i inplace -v imageid=${IMAGEID} -v trackid=${TRACKID} 'BEGIN{FS="\t";OFS="\t"}{if($2==imageid && $3==trackid){$4="null"}{print $0}}' ${DB_FILE}
|
||||||
local $?=1
|
local NONEXISTENT=true
|
||||||
fi
|
fi
|
||||||
[[ $? -eq 0 ]] || { echo "[>>>>>>] Error reported"; echo "${TRACKID} of ${IMAGEID} points to non-existent file"}; local ERR=true; }
|
[[ "${NONEXISTENT}" == "true" ]] && { echo "[>>>>>>] Error reported"; echo "${TRACKID} of ${IMAGEID} points to non-existent file"}; local ERR=true; }
|
||||||
local COUNT=$(( ${COUNT} + 1 ))
|
local COUNT=$(( ${COUNT} + 1 ))
|
||||||
done
|
done
|
||||||
[[ "${ERR}" == "true" ]] && return 1 || return 0
|
[[ "${ERR}" == "true" ]] && return 1 || return 0
|
||||||
|
|
Loading…
Reference in a new issue