Ignore:
Timestamp:
02/11/14 18:41:24 (10 years ago)
Author:
pinsard
Message:

fix thanks to coding rules

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/get_pirata_netcdf.sh

    r199 r203  
    1313# ======== 
    1414# 
    15 # :: 
    16 # 
    17 $ get_pirata_netcdf.sh 
     15# .. code-block:: bash 
     16# 
     17  get_pirata_netcdf.sh 
    1818# 
    1919# DESCRIPTION 
     
    6666# ======== 
    6767# 
    68 # You don't have any PIRATA reference data, you just have to run this tool :: 
    69 # 
    70 #  $ get_pirata_netcdf.sh 
    71 # 
    72 # And look at log file with :: 
    73 # 
    74 #  $ tlogd.sh get_pirata_netcdf 
     68# You don't have any PIRATA reference data, you just have to run this tool : 
     69# 
     70# .. code-block:: bash 
     71# 
     72#    get_pirata_netcdf.sh 
     73# 
     74# And look at log file with : 
     75# 
     76# .. code-block:: bash 
     77# 
     78#    tlogd.sh get_pirata_netcdf 
    7579# 
    7680# and of course on files in ${PROJECT_ID}. 
     
    112116system=$(uname) 
    113117case "${system}" in 
    114    AIX|IRIX64) 
    115       echo "www : no specific posix checking" 
    116    ;; 
    117    *) 
    118      set -o posix 
    119    ;; 
     118    AIX|IRIX64) 
     119        echo "www : no specific posix checking" 
     120    ;; 
     121    *) 
     122        set -o posix 
     123    ;; 
    120124esac 
    121125unset system 
     
    141145if [ ${status} -ne 0 ] 
    142146then 
    143    echo "${command} : eee : tool ${tool} not found" 
    144    exit 1 
     147    echo "${command} : eee : tool ${tool} not found" 
     148    exit 1 
    145149fi 
    146150unset status 
     
    150154if [ "${PROJECT_LOG}" = "" ] 
    151155then 
    152    echo "${command} : eee : \${PROJECT_LOG} not defined" 
    153    exit 1 
     156    echo "${command} : eee : \${PROJECT_LOG} not defined" 
     157    exit 1 
    154158fi 
    155159# 
     
    157161if [ ! -d ${PROJECT_LOG} ] 
    158162then 
    159    echo "${command} : eee : ${PROJECT_LOG} not found" 
    160    exit 1 
     163    echo "${command} : eee : ${PROJECT_LOG} not found" 
     164    exit 1 
    161165fi 
    162166# 
     
    164168if [ ! -x ${PROJECT_LOG} ] 
    165169then 
    166    echo "${command} : eee : ${PROJECT_LOG} not reachable" 
    167    exit 1 
     170    echo "${command} : eee : ${PROJECT_LOG} not reachable" 
     171    exit 1 
    168172fi 
    169173# 
     
    171175if [ ! -w ${PROJECT_LOG} ] 
    172176then 
    173    echo "${command} : eee : ${PROJECT_LOG} not writable" 
    174    exit 1 
     177    echo "${command} : eee : ${PROJECT_LOG} not writable" 
     178    exit 1 
    175179fi 
    176180# 
     
    198202for site in ${sitelist} 
    199203do 
    200    for var in ${varlist} 
    201    do 
    202        list_url="${list_url} ${locref}/${var}${site}_dy.cdf" 
    203    done 
     204    for var in ${varlist} 
     205    do 
     206        list_url="${list_url} ${locref}/${var}${site}_dy.cdf" 
     207    done 
    204208done 
    205209unset site 
     
    212216for url in ${list_url} 
    213217do 
    214   file=${PROJECT_ID}/$(basename ${url}) 
    215   if [ ! -f ${file} ] 
    216   then 
    217      wget --tries=1 --no-verbose -P ${PROJECT_ID} \ 
     218    file=${PROJECT_ID}/$(basename ${url}) 
     219    if [ ! -f ${file} ] 
     220    then 
     221        wget --tries=1 --no-verbose -P ${PROJECT_ID} \ 
    218222        --user=taopmelftp \ 
    219223        --password=G10b@LCh@Ng3 \ 
    220224        ${url} >> ${log} 2>&1 
    221      wget_status=${?} 
    222      if [ ${wget_status} -ne 0 ] 
    223      then 
    224         echo "${command} : eee : ${url} not found" >> ${log} 2>&1 
    225         # ++ exit 1 
    226      else 
    227         echo "${command} : iii : ${url} found" >> ${log} 2>&1 
    228      fi 
    229      unset wget_status 
    230   else 
    231      echo "iii : ${file} exists" >> ${log} 
    232   fi 
     225        wget_status=${?} 
     226        if [ ${wget_status} -ne 0 ] 
     227        then 
     228            echo "${command} : eee : ${url} not found" >> ${log} 2>&1 
     229            # ++ exit 1 
     230        else 
     231            echo "${command} : iii : ${url} found" >> ${log} 2>&1 
     232        fi 
     233        unset wget_status 
     234    else 
     235        echo "iii : ${file} exists" >> ${log} 
     236    fi 
    233237done 
    234238unset file 
Note: See TracChangeset for help on using the changeset viewer.