Last change
on this file since 44 was
31,
checked in by pinsard, 17 years ago
|
remove nemo in elements names and filenames
|
-
Property svn:keywords set to
Id
|
File size:
1.7 KB
|
Line | |
---|
1 | #!/bin/sh |
---|
2 | # |
---|
3 | # module : |
---|
4 | # publication (rsync) of dirwww content on dirpublish given in argument |
---|
5 | # |
---|
6 | # If the host of publication is cerbere.locean-ipsl.upmc.fr, a specific update |
---|
7 | # is launched. |
---|
8 | # |
---|
9 | # update : |
---|
10 | # $Id$ |
---|
11 | # fplod 2007-09-28T09:30:43Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
12 | # parametrisation and translation |
---|
13 | # smasson 2007-06-07T16:43:42Z arete.locean-ipsl.upmc.fr (Darwin) |
---|
14 | # can give the answer with input parameters |
---|
15 | # fplod 2007-04-26T11:51:42Z aedon.locean-ipsl.upmc.fr (Darwin) |
---|
16 | # |
---|
17 | set -o posix |
---|
18 | command=$(basename ${0} .sh) |
---|
19 | log_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") |
---|
20 | log=/tmp/${command}.${log_date} |
---|
21 | # |
---|
22 | usage=" Usage : ${command} -w dirwww -p dirpublish" |
---|
23 | # |
---|
24 | minargcount=4 |
---|
25 | #echo " narg ${#}" |
---|
26 | if [ ${#} -lt ${minargcount} ] |
---|
27 | then |
---|
28 | echo "eee : not enought arguments" |
---|
29 | echo "${usage}" |
---|
30 | exit 1 |
---|
31 | fi |
---|
32 | # |
---|
33 | while [ ! -z "${1}" ] |
---|
34 | do |
---|
35 | case ${1} in |
---|
36 | -w) |
---|
37 | dirwww=${2} |
---|
38 | shift |
---|
39 | ;; |
---|
40 | -p) |
---|
41 | dirpublish=${2} |
---|
42 | shift |
---|
43 | ;; |
---|
44 | esac |
---|
45 | shift # next flag |
---|
46 | done |
---|
47 | # |
---|
48 | set -u |
---|
49 | # |
---|
50 | # ++ check directories |
---|
51 | # |
---|
52 | answer=${1:-" "} |
---|
53 | case ${answer} in |
---|
54 | y|Y|n|N) |
---|
55 | ;; |
---|
56 | *) |
---|
57 | echo "Do you want to install on ${dirpublish} (y|[n]) ?" |
---|
58 | read answer |
---|
59 | ;; |
---|
60 | esac |
---|
61 | case ${answer} in |
---|
62 | y|Y) |
---|
63 | # copy of ${dirwww} on $dirpublish |
---|
64 | echo "iii : update of ${dirpublish}" |
---|
65 | rsync -av -e ssh ${dirwww}/ ${dirpublish} |
---|
66 | # detect if in dirpublish following this pattern [USER@]HOST:SRC, HOST |
---|
67 | # is cerbere.locean-ipsl.upmc.fr. If so, a specific update is launched |
---|
68 | userhost=${dirpublish%%:*} |
---|
69 | host=${userhost##*@} |
---|
70 | user=${userhost%%@*} |
---|
71 | if [ "${host}" = "cerbere.locean-ipsl.upmc.fr" ] |
---|
72 | then |
---|
73 | wget -q "http://www.lodyc.jussieu.fr/info_reseau/persoweb/?fastupdate=1&user=${user}" -O /dev/null |
---|
74 | fi |
---|
75 | ;; |
---|
76 | *) |
---|
77 | echo "no update of ${dirpublish}" |
---|
78 | ;; |
---|
79 | esac |
---|
80 | # |
---|
81 | # normal exit |
---|
82 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.