CheckConfPass.sh
1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/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
conftozerosix=$(grep -c -E 'confidence="0.600"' "$1")
confall=$(grep -c -E 'confidence=' "$1")
if [ $confall -gt 0 ]
then
pourcentageofzerosix=$((($conftozerosix*100)/$confall))
if [ $pourcentageofzerosix -gt 49 ]
then
return 1
else
return 0
fi
fi
else
return 1
fi
fi
return 0
}