CheckSecondPass.sh 1.03 KB
#!/bin/bash

#################################################
# File :    CheckSecondPass.sh                  #
# Brief :   Check Second Pass                   #
# Author :  Jean-François Rey                   #
# Version : 1.0                                 #
# Date :    17/06/13                            #
#################################################

# configuration file
. "$OTMEDIA_HOME/cfg/SecondPass.cfg"


#check_second_pass_output_speeral(plplist,resdir)
# - plplist : filename containing plp list
# - resdir  : output Speeral directory 
function check_second_pass_output_speeral()
{
    if [ $# -eq 2 ]
    then
        if [ ! -e "$1" ] || [ -z "$1" ]; then return 1; fi
        FILENBSEG=$(ls "$2/*.seg" | grep -f "$1" | wc -l)
        FILENBRES=$(ls "$2/*.res" | grep -f "$1" | wc -l)
        FILENBTREIL=$(ls "$2/*.treil" | grep -f "$1" | wc -l)
        FILENB=$(cat "$1" | wc -l)    
        if [ $FILENB -ne $FILENBSEG ] || [ $FILENB -ne $FILENBRES ] || [ $FILENB -ne $FILENBTREIL ] ; then return 1;fi
    fi
    return 0
}