X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Linux%2Fscripts%2FInstall-Creatools-Bin.sh;h=ad06f78d0d532f9283c3794e58b491c42374b412;hb=e79d72630bd419d3223605aecbc3ca44360a30f6;hp=cdcf5915e47caa035faa89bada3789f7ffe4eae6;hpb=0e3fb707f53d363164b58b8fb86115a5d9de5c02;p=creaToolsTools.git diff --git a/Linux/scripts/Install-Creatools-Bin.sh b/Linux/scripts/Install-Creatools-Bin.sh index cdcf591..ad06f78 100755 --- a/Linux/scripts/Install-Creatools-Bin.sh +++ b/Linux/scripts/Install-Creatools-Bin.sh @@ -21,10 +21,7 @@ # knowledge of the CeCILL-B license and that you accept its terms. # ------------------------------------------------------------------------ - -#!/bin/bash - - +#!/bin/bash -e ########################################### function getDistrib { @@ -38,24 +35,42 @@ function getDistrib { 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" + downloadCpmmand=aria2c + ;; + Fedora) + echo Root password: + su -c "yum install aria2 -y" + downloadCpmmand=aria2c + ;; + Ubuntu) + echo Root password: + su -c "apt-get --yes install wget" + downloadCpmmand=wget + ;; + MacOS) + port install curl -y + downloadCpmmand=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 +$downloadCpmmand http://www.creatis.insa-lyon.fr/software/public/creatools/creaTools/creatools-Linux-Bin.sh +source creatools-Linux-Bin.sh cd .. +