updateAmda
3.87 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/bash
# --install | -i ; --update-internal | -u ; --with-remote | -r ; --generate-param-args | -a ; -update-param-args | -p ;
# --spase-synchro | -s ; --clean-new-meta | -c ; --help | -h;
export UPDATEDIR=`pwd`/$(dirname "$0")
. $UPDATEDIR/updateEnv.sh
for option in $@
do
case $option in
--install | -i) INSTALL=1
;;
--update-internal | -u) UPDATE=1
;;
--with-remote | -r) REMOTE=1
;;
--generate-param-args | -a) PARAM_INFO=1
CLEAN_ARGS=1
;;
--update-param-args | -p) PARAM_INFO=1
;;
--spase-synchro | -s) SYNCHRO=1
;;
--clean-new-meta | -c) CLEAN_NEWMETA=1
;;
--help | -h) echo "updateAmda --install | -i ; --update-internal | -u ; --with-remote | -r ; --generate-param-args | -a ; -update-param-args | -p ; --spase-synchro | -s ; --clean-new-meta | -c ; --help | -h;"
exit
;;
*) echo "Invalid option" $option
exit
;;
esac
done
#Please export DDUSER and DDPASS in the shell !!!!
if [ $PARAM_INFO ] && [[ -z ${DDUSER+x} || -z ${DDPASS+x} ]]
then
echo "Warning : DDUSER and DDPASS should be defined to generate params info"
echo "No params info generation will be done!!!"
unset PARAM_INFO
#export DDUSER=XXXX
#export DDPASS=XXXX
fi
# In the case of SPASE synchro export SPASEUSER
if [ -z ${SPASEUSER+x} ] && [ $SYNCHRO ]
then
echo "SPASEUSER should be defined to SYNCHRO SPASE Registry"
echo "No SYNHRO wil be done!!!"
#export SPASEUSER=XXXX
unset SYNCHRO
fi
if [ $CLEAN_NEWMETA ]
then
echo "cleaning in NEWMETA.."
# cleanNewMetaLight
$UPDATEDIR/cleanNewMetaLight
$UPDATEDIR/cleanNewMetaParamInfo
echo "clean in NEWMETA : done"
exit
fi
if [ $INSTALL ]
then
echo "Installing...."
echo "cleaning in NEWMETA.."
$UPDATEDIR/cleanNewMetaLight
echo "clean in NEWMETA : done"
echo "cleaning in AMDA_IHM/generic_data AMDA_Kernel/config..."
$UPDATEDIR/cleanExistingInstallation
echo "clean in AMDA_IHM/generic_data AMDA_Kernel/config : done"
echo "making Amda From Spase..."
if [ $SYNCHRO ]
then
php $AMDA_SPASE_INTERFACE/makeAmdaFromSpase.php "synchro"
else
php $AMDA_SPASE_INTERFACE/makeAmdaFromSpase.php
fi
echo "make Amda From Spase : done"
echo "making Tree..."
php $UPDATEDIR/makeTree.php
echo "make Tree : done"
echo "copying 2 amda..."
$UPDATEDIR/cp2amda
echo "copy 2 amda : done"
echo "making Orbits..."
$UPDATEDIR/makeOrbits
echo "make Orbits : done"
fi
# Update StartStop only
if [ $UPDATE ]
then
echo "Updating...."
if [ $SYNCHRO ]
then
php $AMDA_SPASE_INTERFACE/updateStartStop.php 'synchro'
else
php $AMDA_SPASE_INTERFACE/updateStartStop.php
fi
echo 'update in NEWMETA/dd_missions: done'
echo "making Tree..."
php $UPDATEDIR/makeTree.php
echo "make Tree : done"
if [ -d $AMDAINSTALLATION/AMDA_IHM/generic_data/LocalData ] && [ -e ./LocalParams.xml ]
then
mv ./LocalParams.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/LocalData
fi
echo 'copy 2 amda : done'
echo "updating OrbitsInfo..."
php $AMDAINSTALLATION/AMDA_IHM/php/RemoteDataCenter/makeOrbitsInfo.php
echo "update OrbitsInfo : done"
fi
if [ $PARAM_INFO ]
then
echo "Generating param info...."
if [ $CLEAN_ARGS ]; then
$UPDATEDIR/cleanNewMetaParamInfo
fi
generate_param_info
# copy info for parameter arguments
if [ ! -d $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo ]; then
mkdir $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
fi
if [ -d $NEWMETA/ParamInfo ]
then
cp $NEWMETA/ParamInfo/info*.xml $AMDAINSTALLATION/AMDA_IHM/generic_data/ParamInfo
fi
echo "generate info for arguments : done"
fi
if [ $REMOTE ]
then
echo "making Remote"
$UPDATEDIR/makeRemote
echo "make Remote : done"
fi