1 | #! /bin/sh |
---|
2 | # |
---|
3 | # module : |
---|
4 | # ++ working on getsaxo.xml before processing for HTML and wiki |
---|
5 | # |
---|
6 | # TODO |
---|
7 | # ==== |
---|
8 | # |
---|
9 | # file in/out parameters to be usable correctly in makefile |
---|
10 | # |
---|
11 | # update : |
---|
12 | # $Id$ |
---|
13 | # |
---|
14 | # fplod 2008-04-15T10:53:26Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
15 | # creation from makehtml.sh |
---|
16 | # adapation to docbook 5.0 |
---|
17 | # |
---|
18 | set -u |
---|
19 | set -o posix |
---|
20 | # |
---|
21 | case $( whoami ) in |
---|
22 | smasson) |
---|
23 | lgforge=smasson |
---|
24 | ;; |
---|
25 | floseb) |
---|
26 | lgforge=smasson |
---|
27 | ;; |
---|
28 | *) |
---|
29 | lgforge=saxo |
---|
30 | ;; |
---|
31 | esac |
---|
32 | # |
---|
33 | # size of SRC and DATA with .svn |
---|
34 | szallsvn=$( du -sh ../../.. | awk '{print $1}' ) |
---|
35 | szallsvn=${szallsvn%*M} |
---|
36 | # size of SRC with .svn |
---|
37 | szsrcsvn=$( du -sh ../../../SRC | awk '{print $1}' ) |
---|
38 | szsrcsvn=${szsrcsvn%*M} |
---|
39 | # size of DATA with .svn |
---|
40 | szdatasvn=$( du -sh ../../../DATA | awk '{print $1}' ) |
---|
41 | szdatasvn=${szdatasvn%*M} |
---|
42 | # |
---|
43 | echo "iii : you will be asked ${lgforge}@forge.ipsl.jussieu.fr passwd two times" |
---|
44 | # |
---|
45 | # find the most recent SAXO_SRC_yyyymmddrxxx.tar.gz in |
---|
46 | # /ipsl/forge/projets/saxo/download/ |
---|
47 | infosrc=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_SRC_*.tar.gz | head -n 1) |
---|
48 | filesrc=$(echo ${infosrc} | awk '{print $NF}') |
---|
49 | szsrc=$(echo ${infosrc} | awk '{print $5}') |
---|
50 | # |
---|
51 | # ndate is the date in the file SAXO_SRC_*.tar.gz |
---|
52 | ndate=${filesrc##*_} |
---|
53 | ndate=${ndate%.tar.gz} |
---|
54 | # |
---|
55 | # find the most recent SAXO_DATA_yyyymmddrxxx.tar.gz in |
---|
56 | # /ipsl/forge/projets/saxo/download/ |
---|
57 | infodata=$(ssh ${lgforge}@forge.ipsl.jussieu.fr ls -lht /ipsl/forge/projets/saxo/download/SAXO_DATA_*.tar.gz | head -n 1) |
---|
58 | filedata=$(echo ${infodata} | awk '{print $NF}') |
---|
59 | szdata=$(echo ${infodata} | awk '{print $5}') |
---|
60 | # |
---|
61 | # ndate2 is the date in the file SAXO_DATA_*.tar.gz |
---|
62 | ndate2=${filedata##*_} |
---|
63 | ndate2=${ndate2%.tar.gz} |
---|
64 | # |
---|
65 | sed -e s/"\&date\;"/${ndate}/g \ |
---|
66 | -e s/"\&date2\;"/${ndate2}/g \ |
---|
67 | -e s/"\&szsrc\;"/${szsrc}/g \ |
---|
68 | -e s/"\&szdata\;"/${szdata}/g \ |
---|
69 | -e s/"\&szallsvn\;"/${szallsvn}/g \ |
---|
70 | -e s/"\&szsrcsvn\;"/${szsrcsvn}/g \ |
---|
71 | -e s/"\&szdatasvn\;"/${szdatasvn}/g \ |
---|
72 | getsaxo.xml > getsaxo_sed.xml |
---|
73 | # |
---|
74 | # exit |
---|
75 | exit 0 |
---|