blob: 3fc0d3989715e2b23f28746671c8c2fa11b941bc (
plain)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#!/bin/sh
DEBUG=0
function cdAndExit() {
cd - >> /dev/null
exit $1
}
function usage() {
echo "$0 <envronment file>"
exit 3
}
if [ $# -ne 1 ]
then
usage
fi
envFile=$1
echo $envFile
source $envFile
#source ./envCatalogBE.sh
echo "******************************************"
echo "********* CATALOG_FE_HOST $CATALOG_FE_HOST "
echo "********* CATALOG_FE_PORT $CATALOG_FE_PORT "
echo "********* CATALOG_BE_HOST $CATALOG_BE_HOST "
echo "********* CATALOG_BE_PORT $CATALOG_BE_PORT "
echo "******************************************"
if [[ ${DEBUG} -eq 1 ]]
then
read stam
fi
for folder in *
do
if [[ -d $folder && $folder != "env" ]]
then
echo "processing folder" $folder
cd $folder
commandResult=`./command`
if [ $? -ne 0 ]
then
echo "command $folder failed"
cdAndExit 2
fi
echo "command result is $commandResult"
results=`cat results`
echo "Going to match $commandResult with pattern $results"
matchNumber=`echo $commandResult | grep -c "$results" `
echo $matchNumber
if [ $matchNumber -eq 1 ]
then
echo "command $folder succeed."
else
echo "command $folder failed. Going to exit"
cdAndExit 1
fi
echo "Finish processing folder $folder"
echo "********************************************************"
cd - >> /dev/null
#if folder
fi
#loop on folder
done
echo "***************************************"
echo "* SUCCESS ${envFile} *"
echo "***************************************"
|