]> Creatis software - creaToolsTools.git/blobdiff - Linux/scripts/LocalFunctions.sh
#3405 creaToolsTools Feature New Normal - vtk8itk5wx3-macos
[creaToolsTools.git] / Linux / scripts / LocalFunctions.sh
index a09a466cd52d83d017873e227651fcc1d1181877..662fbae0d65c126df57ced28728e28c141813ad4 100644 (file)
@@ -65,7 +65,11 @@ function getDistrib {
        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`
+       elif [ "$OS" == Linux  ] ; then 
+               OS=`awk 'NR==1{print $1}' /etc/system-release`
+               if [ "$OS" == "" ] ; then 
+                       OS=$(lsb_release -i | awk '{print $3}')
+               fi
     else OS=""
     fi
 # checkDistrib $OS
@@ -117,7 +121,9 @@ function getDownloadCommand {
 ###########################################
 function getncore {
     if [ `uname` == Darwin ] ; then # MacOS
-        system_profiler | grep Processor | awk '$1=="Number" {print $4}'
+#EED 2018-08-26
+#        system_profiler | grep Processor | awk '$1=="Number" {print $4}'
+        sysctl hw.physicalcpu hw.logicalcpu | grep logicalcpu | awk '{print $2}'
     else
         cat /proc/cpuinfo | grep processor | wc -l
     fi