makeRemote 1.28 KB
#!/bin/bash

#
#   
#
   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

#
#  "AMDA side" ( IMPEX-like ) data centers
#
   
	# check if Orbites.xml exists; if not create it !
	if [ ! -f "$LocalData/OrbitsAll.xml" ]; then   
		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
	
	# make help/simu/simu[TARGET]
	php  $AMDA_IHM/php/RemoteDataCenter/makeOrbitsInfo.php
	
	# make template args
	php  $AMDA_IHM/php/RemoteDataCenter/makeArgs.php
	
	if  [ ! -f "$RemoteData/Bases.xml" ]; then 
		mkdir -m 775 -p $RemoteData
		cp $AMDA_IHM/php/RemoteDataCenter/Bases.xml $RemoteData
	fi
	
#
#  "DDBASE side" ( CDAWEB-like ) data centers
#
	
	sudo chmod -R g+wrx $RemoteData
	sudo chmod -R g+wrx $PARAMS_LOCALDB_DIR
	
	php $AMDA_IHM/php/RemoteDataCenter/getRemoteDDBaseProxies.php
	
	# copy "DDBASE" Remote Params descriptions
	if [ -d "$RemoteData/PARAMS" ]; then
		cp $AMDA_IHM/generic_data/RemoteData/PARAMS/* $PARAMS_LOCALDB_DIR/
	fi