Skip to content
Snippets Groups Projects
Commit a50e5a23 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- enhanced validators

- fix in cmd call
parent eb39fe67
No related branches found
No related tags found
No related merge requests found
...@@ -81,16 +81,20 @@ declare -A validators ...@@ -81,16 +81,20 @@ declare -A validators
# filetype has max 4 chars # filetype has max 4 chars
# stage has max 9 chars # stage has max 9 chars
# each validator should return true if file was valid # each validator should return true if file was valid
validators[__mediathek_mkv__current]="/usr/bin/mediaconch -ft -p /etc/mediaconch/profile,xml FILE" validators[__mediathek_mka__current]="/usr/bin/mediaconch -ft -p /etc/mediaconch/mediathek_retroaudio.xml FILE"
validators[__mediathek_mkv_upcoming]="/usr/bin/mediaconch -ft -p /etc/mediaconch/profile,xml FILE" validators[__mediathek_mka_upcoming]="/usr/bin/mediaconch -ft -p /etc/mediaconch/mediathek_retroaudio.xml FILE"
validators[_______save_mkv__current]="/usr/bin/mediaconch -ft -p /etc/mediaconch/save_retrovideofilm_current.xml FILE"
validators[_______save_mkv_upcoming]="/usr/bin/mediaconch -ft -p /etc/mediaconch/save_retrovideofilm_upcoming.xml FILE"
validators[_______save_mka__current]="/usr/bin/mediaconch -ft -p /etc/mediaconch/save_retroaudio_current.xml FILE"
validators[_______save_mka_upcoming]="/usr/bin/mediaconch -ft -p /etc/mediaconch/save_retroaudio_current.xml FILE"
validators[_____kitodo_tif__current]="/usr/bin/checkit_tiff_current /etc/checkit_tiff/retromono_current FILE" validators[_____kitodo_tif__current]="/usr/bin/checkit_tiff_current /etc/checkit_tiff/retromono_current FILE"
validators[_____kitodo_tif_upcoming]="/usr/bin/checkit_tiff_upcoming /etc/checkit_tiff/retromono_upcoming FILE" validators[_____kitodo_tif_upcoming]="/usr/bin/checkit_tiff_upcoming /etc/checkit_tiff/retromono_upcoming FILE"
validators[______lfulg_tif__current]="/usr/bin/checkit_tiff_current /etc/checkit_tiff/retrogeomono_current FILE"
validators[______lfulg_tif_upcoming]="/usr/bin/checkit_tiff_upcoming /etc/checkit_tiff/retrogeomono_upcoming FILE"
validators[___fotothek_tif__current]="/usr/bin/checkit_tiff_current /etc/checkit_tiff/retrofoto_current FILE" validators[___fotothek_tif__current]="/usr/bin/checkit_tiff_current /etc/checkit_tiff/retrofoto_current FILE"
validators[___fotothek_tif_upcoming]="/usr/bin/checkit_tiff_upcoming /etc/checkit_tiff/retrofoto_upcoming FILE" validators[___fotothek_tif_upcoming]="/usr/bin/checkit_tiff_upcoming /etc/checkit_tiff/retrofoto_upcoming FILE"
set -o nounset # Treat unset variables as an error set -o nounset # Treat unset variables as an error
# Don't just call this function "help()", as that's a reserved command in Bash. # Don't just call this function "help()", as that's a reserved command in Bash.
...@@ -296,13 +300,13 @@ scan_file() { ...@@ -296,13 +300,13 @@ scan_file() {
debug "scan_file, using stage: $stage (STAGE mode '$STAGE')" debug "scan_file, using stage: $stage (STAGE mode '$STAGE')"
cmd=$(prepare_cmd "$MODE" "$ftype" "$stage" | sed -e "s#FILE#'$filename'#") cmd=$(prepare_cmd "$MODE" "$ftype" "$stage" | sed -e "s#FILE#'$filename'#")
debug "scan_file, calling cmd='$cmd'" debug "scan_file, calling cmd='$cmd'"
"$cmd" || ( error "failed call of '$cmd', $?"; exit 1) $cmd || ( error "failed call of '$cmd', $?"; exit 1 )
done done
else else
debug "scan_file, using stage: $STAGE" debug "scan_file, using stage: $STAGE"
cmd=$(prepare_cmd "$MODE" "$ftype" "$STAGE" | sed -e "s#FILE#'$filename'#") cmd=$(prepare_cmd "$MODE" "$ftype" "$STAGE" | sed -e "s#FILE#'$filename'#")
debug "scan_file, calling cmd='$cmd'" debug "scan_file, calling cmd='$cmd'"
"$cmd" || ( error "failed call of '$cmd', $?"; exit 1) $cmd || ( error "failed call of '$cmd', $?"; exit 1 )
fi fi
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment