source: ether_iasi_L1C/trunk/create_uproc.sh @ 27

Last change on this file since 27 was 27, checked in by cbipsl, 17 years ago

validation creation appli extraction L1C

  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.0 KB
Line 
1#!/bin/sh
2
3Loginu=$1
4Date=$2
5Mailu=$3
6Mot_iasi=$4
7Sat=$5
8Lati=$6
9Long=$7
10Indtm=$8
11Indjn=$9
12
13
14cd ${@:10:1} 
15
16conf_file="conf.txt"
17while read line
18do
19        ll=${#line}
20
21        if [[ -n $(echo $line | grep PATH_PROG) ]] ; then
22                chem=`expr $ll - 11`
23                temp=`echo $line | cut -c11-$ll`
24                PATH_PROG=$temp
25        fi
26        if [[ -n $(echo $line | grep PATH_LOGS) ]] ; then
27                chem=`expr $ll - 11`
28                temp=`echo $line | cut -c11-$ll`
29                PATH_LOGS=$temp
30        fi
31        if [[ -n $(echo $line | grep PATH_SUN_WEB_SERVICES) ]] ; then
32                chem=`expr $ll - 23`
33                temp=`echo $line | cut -c23-$ll`
34                PATH_SUN_WEB_SERVICES=$temp
35        fi
36        if [[ -n $(echo $line | grep PATH_Orbiasi_l1b) ]] ; then
37                chem=`expr $ll - 18`
38                temp=`echo $line | cut -c18-$ll`
39                PATH_Orbiasi_l1b=$temp
40        fi
41        if [[ -n $(echo $line | grep PATH_TEMP) ]] ; then
42                chem=`expr $ll - 11`
43                temp=`echo $line | cut -c11-$ll`
44                PATH_TEMP=$temp
45        fi
46        if [[ -n $(echo $line | grep PATH_RES) ]] ; then
47                chem=`expr $ll - 10`
48                temp=`echo $line | cut -c10-$ll`
49                PATH_RES=$temp
50        fi
51        if [[ -n $(echo $line | grep WEB_SERVER) ]] ; then
52                chem=`expr $ll - 12`
53                temp=`echo $line | cut -c12-$ll`
54                WEB_SERVER=$temp
55        fi
56       
57
58
59
60
61done < $conf_file
62
63
64echo "PATH_LOGS=$PATH_LOGS"
65echo "PATH_PROG=$PATH_PROG"
66echo "PATH_Orbiasi_l1b=$PATH_Orbiasi_l1b"
67echo "PATH_TEMP=$PATH_TEMP"
68echo "PATH_RES=$PATH_RES"
69echo "WEB_SERVER=$WEB_SERVER"
70
71DATE=$(date +%Y%m%d-%H%M)
72
73file_logs="$PATH_LOGS/iasi_l1c_user_request_$Loginu_$DATE.txt"
74
75echo "Start user request treatment" >> $file_logs 
76echo "Creation of user tempory rep" >> $file_logs 
77
78cd $PATH_PROG
79./create_repu -l $Loginu -d $DATE -logs $file_logs
80sleep 1
81cd $PATH_TEMP/$Loginu/Order_$DATE
82echo $Loginu > requete.txt
83echo $Mailu >> requete.txt
84echo $Date >> requete.txt
85echo $Mot_iasi >> requete.txt
86echo $Sat >> requete.txt
87echo $Lati >> requete.txt
88echo $Long >> requete.txt
89echo $Indtm >> requete.txt
90echo $Indjn >> requete.txt
91
92if [ $Indtm -eq 0 ]; then
93        tIndtm="Sea"
94fi
95if [ $Indtm -eq 1 ]; then
96        tIndtm="Land"
97fi
98if [ $Indtm -eq 2 ];
99then
100        tIndtm="Land and sea"
101fi
102
103if [ $Indjn -eq 0 ]; then
104        tIndjn="Night"
105fi
106if [ $Indjn -eq 1 ]; then
107        tIndjn="Day"
108fi
109if [ $Indjn -eq 2 ]; then
110        tIndjn="Night and day"
111fi
112
113
114echo "Copy of user request parameters in $PATH_TEMP/$Loginu/Order_$DATE/request.txt" >> $file_logs 
115
116echo $PATH_TEMP/$Loginu/Order_$DATE >> requete.txt
117echo $DATE >> requete.txt
118
119cp requete.txt $PATH_PROG
120chmod 755 requete.txt
121
122echo "Request process" >> $file_logs
123cp $PATH_PROG/treat_request.sh .
124cp $PATH_PROG/conf.txt .
125
126./treat_request.sh -f requete.txt -logs $file_logs
127
128var=$?
129
130if [ $var -eq 0 ]; then
131        ssh $WEB_SERVER "mkdir $PATH_RES/$Loginu/Order_$DATE ; chmod 755 $PATH_RES/$Loginu/Order_$DATE"
132        scp $PATH_TEMP/IASI_mots_all_spots_$Loginu_$DATE* $WEB_SERVER:$PATH_RES/$Loginu/Order_$DATE
133
134        echo "The result of your request is in the repository Order_$DATE in your user space.
135
136Date range : $Date
137Channels : $Mot_iasi
138Latitude range : $Lati
139Longitude range : $Long
140Land/sea index : $tIndtm
141Night/day index : $tIndjn
142
143Le service Ether" > $PATH_TEMP/mail_retour_$Loginu_$DATE.txt
144        $PATH_PROG/mailu $Mailu $PATH_TEMP/mail_retour_$Loginu_$DATE.txt
145        /bin/rm $PATH_TEMP/mail_retour_$Loginu_$DATE.txt
146        /bin/rm $PATH_TEMP/IASI_mots_all_spots_$Loginu_$DATE*
147        /bin/rm -R $PATH_TEMP/$Loginu/Order_$DATE
148
149else
150        echo "Your request Order_$DATE has no result.
151
152Date range : $Date
153Channels : $Mot_iasi
154Latitude range : $Lati
155Longitude range : $Long
156Land/sea index : $tIndtm
157Night/day index : $tIndjn
158
159Ether service
160" > $PATH_TEMP/mail_retour_$Loginu_$DATE.txt
161        $PATH_PROG/mailu $Mailu $PATH_TEMP/mail_retour_$Loginu_$DATE.txt
162        /bin/rm $PATH_TEMP/mail_retour_$Loginu_$DATE.txt
163fi
164
165echo "var=$var"
166
167exit $var
168
169
170
171
Note: See TracBrowser for help on using the repository browser.