Blame view

tools/scripts/CheckConfPass.sh 1.14 KB
e6be5137b   Jean-François Rey   reinitialized pro...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  #!/bin/bash
   
  #################################################
  # File :    CheckConfPass.sh                    #
  # Brief :   Check Conf Pass                     #
  # Author :  Jean-François Rey                   #
  # Version : 1.0                                 #
  # Date :    17/06/13                            #
  #################################################
   
  # configuration file
  . "$OTMEDIA_HOME/cfg/ConfPass.cfg"
  
  # check_conf_pass_usf(usffilenamefullpath)
  # -usffilenamefullpath : full path to usf file
  # return 0 if ok, otherwise return 1
  function check_conf_pass_usf()
  {
      if [ $# -ne 1 ]
      then 
          if [ -e "$1" ] && [ -s "$1" ]
          then
9456401f8   Jean-François Rey   modify info and l...
23
24
25
              conftozerosix=$(grep -c -E 'confidence="0.600"' "$1")
              confall=$(grep -c -E 'confidence=' "$1")
              if [ $confall -gt 0 ]
e6be5137b   Jean-François Rey   reinitialized pro...
26
              then
9456401f8   Jean-François Rey   modify info and l...
27
28
29
30
31
32
33
34
                  pourcentageofzerosix=$((($conftozerosix*100)/$confall))
                  if [ $pourcentageofzerosix -gt 49 ]
                  then
                      return 1
  
                  else
                      return 0
                  fi
e6be5137b   Jean-François Rey   reinitialized pro...
35
36
37
38
39
              fi
          else
              return 1
          fi
      fi
e6be5137b   Jean-François Rey   reinitialized pro...
40
41
      return 0
  }