#! /bin/bash VDR_CHECKTS=/usr/local/bin/vdr-checkts if [ "$1" = "" ]; then echo "Usage: vdr-checkts RECORDING_DIR" exit 1 fi if [ ! -x "$VDR_CHECKTS" ] ; then echo "Cannot execute VDR_CHECKTS=${VDR_CHECKTS}, exiting" exit 1 fi if [ ! -r "$1"/00001.ts ] ; then echo "File $1/00001.ts does not exist, exiting" exit 1 fi if [ ! -r "$1"/info ] ; then echo "File $1/info does not exist, exiting" exit 1 fi cut -d\ -f1 "$1"/info | grep -q "O" if [ "$?" = "0" ] ; then echo "Recording was already checked, exiting" exit 1 fi if [ ! -w "$1"/info ] ; then echo "Cannot write to file $1/info, exiting" exit 1 fi echo "checking $1" output=$("${VDR_CHECKTS}" "$1") echo output=$output errors=$(echo "$output" | cut -d\ -f2) #echo errors=$errors echo "O $errors" >> $1/info