Changeset 130


Ignore:
Timestamp:
Jun 20, 2017, 8:41:50 PM (7 years ago)
Author:
g7moreau
Message:
  • Begin remanufactoring
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/softsync/softsync

    r129 r130  
    11#!/bin/bash
    22#
    3 # 2014/09/09 Gabriel Moreau
     3# 2014/09/09 Gabriel Moreau <Gabriel Moreau(A)univ-grenoble-alpes.fr> - Initial release
     4# 2017/06/20 Gabriel Moreau - Trokata Integration
    45
    56export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
     
    1314
    1415SYNOPSIS
    15    $0 -a arch -n soft_name -r release_number [-v] [-h]
     16   $0 -a arch -n soft_name -r release_number [-o os_name] [-d] [-v] [-h]
    1617
    1718OPTIONS
     
    3334   }
    3435
    35 MyVarRSCmd="/usr/bin/ionice -c 3 /usr/bin/nice -18 /usr/bin/rsync"
    36 MyVarRSOpt="--contimeout=3 --timeout=3 --bwlimit=5000 --rsync-path='/usr/bin/ionice -c 3 /usr/bin/nice -18 /usr/bin/rsync'"
     36# Default values
     37rsync_cmd='/usr/bin/ionice -c 3 /usr/bin/nice -18 /usr/bin/rsync'
     38rsync_opt="--contimeout=3 --timeout=3 --bwlimit=5000 --rsync-path='/usr/bin/ionice -c 3 /usr/bin/nice -18 /usr/bin/rsync'"
     39rsync_share='legilnx40::opt/${os_arch}'
     40dest_dir='/opt'
     41
     42if [ -e "/etc/softsyncrc" ]
     43then
     44   . "/etc/softsyncrc"
     45fi
    3746
    3847# get options
     
    4453         if echo ${OPTARG} | egrep -q '^[[:digit:]]+'
    4554         then
    46             export MyVarOSArch=${OPTARG}
     55            export os_arch=${OPTARG}
    4756         else
    4857            usage
     
    8291
    8392      d)
    84          export MyVarRSOpt="${MyVarRSOpt} --delete"
     93         export rsync_opt="${rsync_opt} --delete"
    8594         ;;
    8695
     
    97106
    98107
    99 MyVarRSShare="legilnx40::opt/${MyVarOSArch}"
    100108soft_version_server=${soft_version}
    101109if [ -n "${os_name}" ]
     
    104112fi
    105113
    106 [ -d "/opt/${soft_name}" ] || mkdir -p "/opt/${soft_name}"
    107 if eval ${MyVarRSCmd} -avn ${MyVarRSOpt} ${MyVarRSShare}/${soft_name}/.zz-end.${soft_version_server} /opt/${soft_name}/.zz-end.${soft_version} \
     114[ -d "${dest_dir}/${soft_name}" ] || mkdir -p "${dest_dir}/${soft_name}"
     115if eval ${rsync_cmd} -avn ${rsync_opt} ${rsync_share}/${soft_name}/.zz-end.${soft_version_server} ${dest_dir}/${soft_name}/.zz-end.${soft_version} \
    108116      | /bin/grep -q ^\.zz-end
    109117then
    110    rm -f /opt/${soft_name}/.zz-end.${soft_version}
     118   rm -f ${dest_dir}/${soft_name}/.zz-end.${soft_version}
    111119   [ "${verbose}" == "yes" ] && \
    112       echo ${MyVarRSCmd} -avz ${MyVarRSOpt} ${MyVarRSShare}/${soft_name}/${soft_version_server}/ /opt/${soft_name}/${soft_version}/
    113    if eval ${MyVarRSCmd} -avz ${MyVarRSOpt} ${MyVarRSShare}/${soft_name}/${soft_version_server}/ /opt/${soft_name}/${soft_version}/
     120      eval echo ${rsync_cmd} -avz ${rsync_opt} ${rsync_share}/${soft_name}/${soft_version_server}/ ${dest_dir}/${soft_name}/${soft_version}/
     121   if eval ${rsync_cmd} -avz ${rsync_opt} ${rsync_share}/${soft_name}/${soft_version_server}/ ${dest_dir}/${soft_name}/${soft_version}/
    114122   then
    115       chmod ugo+rX /opt/${soft_name}/
    116       eval ${MyVarRSCmd} -aq ${MyVarRSOpt} ${MyVarRSShare}/${soft_name}/.zz-end.${soft_version_server} /opt/${soft_name}/.zz-end.${soft_version}
     123      chmod ugo+rX ${dest_dir}/${soft_name}/
     124      eval ${rsync_cmd} -aq ${rsync_opt} ${rsync_share}/${soft_name}/.zz-end.${soft_version_server} ${dest_dir}/${soft_name}/.zz-end.${soft_version}
    117125   fi
    118126fi
Note: See TracChangeset for help on using the changeset viewer.