Blame view

update_amda/makeRemote 1.67 KB
4c77b9b1   Elena.Budnik   final update
1
2
3
4
5
#!/bin/bash

#
#   
#
99ae8744   Benjamin Renard   Use config variab...
6
7
8
9
10
11
12
   SCRIPT=$(readlink -f "$0")
   export UPDATEDIR=$(dirname "$SCRIPT")
   . $UPDATEDIR/updateEnv.sh

   if [ ! -d "$AMDA_IHM" ]; then
       echo "[ERROR] check if AMDA_IHM env variable is defined"
   fi
cba7eca7   Elena.Budnik   merge 2 parts of ...
13
14
15
16

#
#  "AMDA side" ( IMPEX-like ) data centers
#
4c77b9b1   Elena.Budnik   final update
17
18
   
	# check if Orbites.xml exists; if not create it !
99ae8744   Benjamin Renard   Use config variab...
19
	if [ ! -f "$LocalData/OrbitsAll.xml" ]; then   
4c77b9b1   Elena.Budnik   final update
20
21
22
23
24
25
26
27
28
29
		php  $AMDA_IHM/php/makeOrbitsList.php
		php  $AMDA_IHM/php/makeOrbitsInKm.php
	fi

	# make Proxies for 'isSimulation' dataCenters from Bases.xml
	php  $AMDA_IHM/php/RemoteDataCenter/makeProxy.php
	
	# make [TARGET].json
	php  $AMDA_IHM/php/RemoteDataCenter/makeOrbitsArgs.php
	
4f91dd57   Elena.Budnik   IMPEX update orbi...
30
31
32
	# make help/simu/simu[TARGET]
	php  $AMDA_IHM/php/RemoteDataCenter/makeOrbitsInfo.php
	
4c77b9b1   Elena.Budnik   final update
33
34
	# make template args
	php  $AMDA_IHM/php/RemoteDataCenter/makeArgs.php
d73734df   Elena.Budnik   add DDBASE Remote...
35
	
99ae8744   Benjamin Renard   Use config variab...
36
	if  [ ! -f "$RemoteData/Bases.xml" ]; then 
cb36b2fe   Elena.Budnik   proper dirs perms
37
		mkdir -m 775 -p $RemoteData
99ae8744   Benjamin Renard   Use config variab...
38
		cp $AMDA_IHM/php/RemoteDataCenter/Bases.xml $RemoteData
cba7eca7   Elena.Budnik   merge 2 parts of ...
39
40
41
42
43
	fi
	
#
#  "DDBASE side" ( CDAWEB-like ) data centers
#
410b9d9f   Elena.Budnik   chmod
44
	
4414dcad   Elena.Budnik   mkdir Remotedata/...
45
	if [ ! -d "$RemoteData/PARAMS" ]; then
d444ba30   Elena.Budnik   mkdir...,0775 doe...
46
		mkdir -m  775 -p $RemoteData/PARAMS
4414dcad   Elena.Budnik   mkdir Remotedata/...
47
48
	fi 
	
d444ba30   Elena.Budnik   mkdir...,0775 doe...
49
50
	# group = apache !
	sudo chmod -R g+wrx $RemoteData $RemoteData/PARAMS $PARAMS_LOCALDB_DIR
410b9d9f   Elena.Budnik   chmod
51
	
cb32ce86   Elena.Budnik   mkdir PATAMS in c...
52
53
	php $AMDA_IHM/php/RemoteDataCenter/getRemoteDDBaseProxies.php
	
d73734df   Elena.Budnik   add DDBASE Remote...
54
	# copy "DDBASE" Remote Params descriptions
99ae8744   Benjamin Renard   Use config variab...
55
	if [ -d "$RemoteData/PARAMS" ]; then
497993cf   Elena.Budnik   delete remote par...
56
57
58
        # remove PARAMS if no such VI in the database
        php $AMDA_IHM/php/RemoteDataCenter/cleanRemoteParams.php
        
d444ba30   Elena.Budnik   mkdir...,0775 doe...
59
60
61
62
		for param_def in $RemoteData/PARAMS/*.xml
			do
				xml=`basename $param_def`
				if [ ! -f "$PARAMS_LOCALDB_DIR/$xml" ]; then
497993cf   Elena.Budnik   delete remote par...
63
64
					#cp $param_def $PARAMS_LOCALDB_DIR/
					ln -s $param_def $PARAMS_LOCALDB_DIR/$xml
d444ba30   Elena.Budnik   mkdir...,0775 doe...
65
66
				fi
			done
d73734df   Elena.Budnik   add DDBASE Remote...
67
	fi 
9b6c46d9   Elena.Budnik   THEMIS Remote center
68