X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Linux%2Fscripts%2FInstall-Creatools-Bin.sh;h=3d569fdb2ef60277ff5550537526da22d05b9610;hb=47b3fdeddecef4f9cfb25b0acac21a2d86fcc7db;hp=8d9e4eed4190d909d7d9d8fbb965a752d9b77092;hpb=4331e28cc8b1d4662dab14f729c8caa0c5c674dc;p=creaToolsTools.git diff --git a/Linux/scripts/Install-Creatools-Bin.sh b/Linux/scripts/Install-Creatools-Bin.sh index 8d9e4ee..3d569fd 100755 --- a/Linux/scripts/Install-Creatools-Bin.sh +++ b/Linux/scripts/Install-Creatools-Bin.sh @@ -21,43 +21,59 @@ # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ - -#!/bin/bash - - +#!/bin/bash -e ########################################### function getDistrib { local OS=`uname` if [ "$OS" == Darwin ] ; then OS=MacOS; - elif [ "$OS" == Linux ] ; then OS=`awk 'NR==1{print $1}' /etc/issue` +##EED2016-10-15 +## elif [ "$OS" == Linux ] ; then OS=$(lsb_release -i | awk '{print $3}') + elif [ "$OS" == Linux ] ; then OS=`awk 'NR==1{print $1}' /etc/system-release` + else OS="" fi # checkDistrib $OS echo $OS } -########################################### -function getDistribVersion { - local DISTRIB=`getDistrib` - if [ "$DISTRIB" == MacOS ] ; then OSVesion=VOID_Darwin_EED; - elif [ "$DISTRIB" == Fedora ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue` - elif [ "$DISTRIB" == Ubuntu ] ; then OSVersion=`awk 'NR==1{print $2}' /etc/issue` - else OSVersion="VOID_EED" - fi - echo $OSVersion -} +OperatingSystem=`getDistrib` -CREATOOLSBINDIR=Creatools-Bin-`getDistrib`-`getDistribVersion` + case "$OperatingSystem" in + Mandriva) + echo Root password: + su -c "urpmi aria2" + downloadCommand=aria2c + ;; + Fedora) + echo Root password: + su -c "yum install aria2 -y" + downloadCommand=aria2c + ;; + Ubuntu) + echo Root password: + su -c "apt-get --yes install wget" + downloadCommand=wget + ;; + MacOS) + port install curl -y + downloadCommand=curl + ;; + *) + echo " '$OperatingSystem' : Unknown (for us...) Operating Sytem " + echo " Allowed values are (right now) Fedora, Ubuntu, MacOS " +// exit 0 + ;; + esac +CREATOOLSBINDIR=Creatools-Bin rm -rf $CREATOOLSBINDIR mkdir $CREATOOLSBINDIR cd $CREATOOLSBINDIR -wget http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/creatools-Linux-BinVersion-`getDistrib`-`getDistribVersion`.sh -source creatools-Linux-BinVersion-`getDistrib`-`getDistribVersion`.sh +$downloadCommand http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/creatools-Linux-Bin.sh +source creatools-Linux-Bin.sh cd .. -