X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Linux%2Fscripts%2FLocalFunctions.sh;fp=Linux%2Fscripts%2FLocalFunctions.sh;h=a09a466cd52d83d017873e227651fcc1d1181877;hb=d3fa23cdd313b5209461d6011a4aeb306350aff8;hp=90624a24f2901c36625ebf4fe142fc741f9113bf;hpb=252395a1ffdecd683d537710bc587c0d9752dafa;p=creaToolsTools.git diff --git a/Linux/scripts/LocalFunctions.sh b/Linux/scripts/LocalFunctions.sh index 90624a2..a09a466 100644 --- a/Linux/scripts/LocalFunctions.sh +++ b/Linux/scripts/LocalFunctions.sh @@ -51,7 +51,7 @@ function bigDisplay { ########################################### function checkDistrib { local OS=$1 - if [ "`checkVal $OS MacOS Fedora Ubuntu Mandriva`" == "false" ] ; then + if [ "`checkVal $OS MacOS Fedora Ubuntu Mandriva CentOS`" == "false" ] ; then echo "Operating System not supported: $OS" echo "Currently supported system: Fedora Ubuntu MacOS" exit 1 @@ -79,17 +79,35 @@ function getDistribVersion { 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` + elif [ "$DISTRIB" == CentOS ] ; then OSVersion=`awk 'NR==1{print $3}' /etc/issue` else OSVersion="VOID_EED" fi echo $OSVersion } +########################################### +function getKernelVersion { + local DISTRIB=`getDistrib` + + if [ "$DISTRIB" == MacOS ] ; then KernelVesion=VOID_Darwin_EED; + elif [ "$DISTRIB" == Fedora ] ; then KernelVersion=$(uname -a | awk '{print $3}') + elif [ "$DISTRIB" == Ubuntu ] ; then KernelVersion=$(uname -a | awk '{print $3}') + elif [ "$DISTRIB" == CentOS ] ; then KernelVersion=$(uname -a | awk '{print $3}') + else KernelVersion="VOID_EED" + fi + echo $KernelVersion +} + + + + ########################################### function getDownloadCommand { local DISTRIB=`getDistrib` if [ "$DISTRIB" == MacOS ] ; then downloadCommand=curl; elif [ "$DISTRIB" == Fedora ] ; then downloadCommand='aria2c -x 16' + elif [ "$DISTRIB" == CentOs ] ; then downloadCommand='aria2c -x 16' elif [ "$DISTRIB" == Ubuntu ] ; then downloadCommand=wget else downloadCommand="VOID_EED" fi