Changeset 23 for trunk/install.sh


Ignore:
Timestamp:
09/28/07 12:27:10 (17 years ago)
Author:
pinsard
Message:

improvement of before and after tasks parametrization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/install.sh

    • Property svn:keywords set to Id
    r14 r23  
    22# 
    33# module : 
    4 # installation des pages bibnemomaf dans DIRFINAL* donné en argument 
    5 # à partir des fichiers produits ou copiés ou liés sous DIRWWW  
    6 # donné en argument 
     4# publication (rsync) of dirwww content on dirpublish given in argument 
    75# 
    8 # nb : !!! attention utilisation du compte fplod@aedon.lodyc.jussieu.fr 
    9 # 
    10 # source : 
    11 # /usr/home/fplod/incas/bibnemo/src/bibnemomaf/install.sh sur aedon.locean-ipsl.upmc.fr 
     6# If the host of publication is cerbere.locean-ipsl.upmc.fr, update_web is 
     7# launched. 
    128# 
    139# update 
     10# $Id$ 
     11# fplod 2007-09-28T09:30:43Z aedon.locean-ipsl.upmc.fr (Darwin) 
     12# parametrisation and translation 
    1413# smasson 2007-06-07T16:43:42Z arete.locean-ipsl.upmc.fr (Darwin) 
    1514# can give the answer with input parameters 
    1615# fplod 2007-04-26T11:51:42Z aedon.locean-ipsl.upmc.fr (Darwin) 
    1716# 
    18 # ++ simu paramètre 
    19 DIRFINALLOCEAN=smasson@arete.locean-ipsl.upmc.fr:Sites/bibnemomaf/ 
    20 DIRWWW=/tmp/bibopa/ 
     17set -o posix 
     18command=$(basename ${0} .sh) 
     19log_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") 
     20log=/tmp/${command}.${log_date} 
     21# 
     22usage=" Usage : ${command} -w dirwww -p dirpublish" 
     23# 
     24minargcount=4 
     25echo " narg ${#}" 
     26if [ ${#} -lt ${minargcount} ] 
     27then 
     28  echo "eee : not enought arguments" 
     29  echo "${usage}" 
     30  exit 1 
     31fi 
     32# 
     33while [ ! -z "${1}" ] 
     34do 
     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 
     46done 
     47# 
     48set -u 
     49# 
     50# ++ check directories 
    2151# 
    2252answer=${1:-" "} 
     
    2555        ;; 
    2656    *) 
    27         echo "Do you want to install on ${DIRFINALLOCEAN}  (y|[n]) ?" 
    28         read answer    
     57        echo "Do you want to install on ${dirpublish}  (y|[n]) ?" 
     58        read answer 
    2959        ;; 
    3060esac 
    3161case ${answer} in 
    3262 y|Y) 
    33  # copy of ${DIRWWW} on $DIRFINALLOCEAN 
    34  echo "iii : update of ${DIRFINALLOCEAN}" 
    35  rsync -av -e ssh ${DIRWWW}/ ${DIRFINALLOCEAN} 
    36  # pas sur aedon ssh fplod@cerbere.lodyc.jussieu.fr /usr/local_linux/bin/update_web 
     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, update_web is launched 
     68 userhost=${dirpublish%%:*} 
     69 host=${userhost##*@} 
     70 if [ "${host}" = "cerbere.locean-ipsl.upmc.fr" ] 
     71 then 
     72  ssh ${userhost} /usr/local_linux/bin/update_web 
     73 fi 
    3774 ;; 
    3875 *) 
    39  echo "no update of ${DIRFINALLOCEAN}" 
    40  ;; 
    41 esac 
    42 # 
    43 # ++ simu paramètre 
    44 DIRFINALLOCEAN=opatlod@cerbere.locean-ipsl.upmc.fr:NEMO/general/biblio_new/ 
    45 # 
    46 answer=${2:-" "} 
    47 case ${answer} in 
    48     y|Y|n|N) 
    49         ;; 
    50     *) 
    51         echo "Do you want to install on ${DIRFINALLOCEAN}  (y|[n]) ?" 
    52         read answer    
    53         ;; 
    54 esac 
    55 case ${answer} in 
    56  y|Y) 
    57  # copy of ${DIRWWW} on $DIRFINALLOCEAN 
    58  echo "iii : update of ${DIRFINALLOCEAN}" 
    59  rsync -av -e ssh ${DIRWWW}/ ${DIRFINALLOCEAN} 
    60  ssh opatlod@cerbere.lodyc.jussieu.fr /usr/local_linux/bin/update_web 
    61  ;; 
    62  *) 
    63  echo "no update of ${DIRFINALLOCEAN}" 
     76 echo "no update of ${dirpublish}" 
    6477 ;; 
    6578esac 
Note: See TracChangeset for help on using the changeset viewer.