X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Linux%2Fscripts%2FLocalFunctions.sh;h=90624a24f2901c36625ebf4fe142fc741f9113bf;hb=0718daf4f3ec2a9ee1a8b201352d9bf4b2b132fa;hp=8d61359c787e51e9312fb08b7b81097d28331aac;hpb=8987c596864a8a2fd7786e6aea59cdd03904ae14;p=creaToolsTools.git diff --git a/Linux/scripts/LocalFunctions.sh b/Linux/scripts/LocalFunctions.sh index 8d61359..90624a2 100644 --- a/Linux/scripts/LocalFunctions.sh +++ b/Linux/scripts/LocalFunctions.sh @@ -62,8 +62,10 @@ function checkDistrib { function getDistrib { local OS=`uname` - if [ "$OS" == Darwin ] ; then OS=MacOS; - elif [ "$OS" == Linux ] ; then OS=`awk 'NR==1{print $1}' /etc/issue` + if [ "$OS" == Darwin ] ; then OS=MacOS; +##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 @@ -72,15 +74,28 @@ function getDistrib { ########################################### function getDistribVersion { - local OS=`uname` + local DISTRIB=`getDistrib` - if [ "$OS" == Darwin ] ; then OSVesion=VOID_Darwin_EED; - elif [ "$OS" == Linux ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue` + if [ "$DISTRIB" == MacOS ] ; then OSVesion=VOID_Darwin_EED; + elif [ "$DISTRIB" == Fedora ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/system-release` + elif [ "$DISTRIB" == Ubuntu ] ; then OSVersion=`awk 'NR==1{print $2}' /etc/issue` else OSVersion="VOID_EED" fi echo $OSVersion } +########################################### +function getDownloadCommand { + local DISTRIB=`getDistrib` + + if [ "$DISTRIB" == MacOS ] ; then downloadCommand=curl; + elif [ "$DISTRIB" == Fedora ] ; then downloadCommand='aria2c -x 16' + elif [ "$DISTRIB" == Ubuntu ] ; then downloadCommand=wget + else downloadCommand="VOID_EED" + fi + echo $downloadCommand +} + ########################################### function getncore { if [ `uname` == Darwin ] ; then # MacOS @@ -112,6 +127,7 @@ function getbashrc { # fi } + ########################################### function printconfig { echo