未验证 提交 d82b27a5 编写于 作者: M Matt Witherspoon 提交者: GitHub

Merge pull request #2602 from wqxiang88/master

Compatible with Ubuntu 17
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
OS_MAJ=`echo "${OS_VER}" | cut -d'.' -f1` OS_MAJ=`echo "${OS_VER}" | cut -d'.' -f1`
OS_MIN=`echo "${OS_VER}" | cut -d'.' -f2` OS_MIN=`echo "${OS_VER}" | cut -d'.' -f2`
MEM_MEG=$( free -m | grep Mem | tr -s ' ' | cut -d\ -f2 ) MEM_MEG=$( free -m | grep Mem | tr -s ' ' | cut -d\ -f2 || cut -d' ' -f2 )
CPU_SPEED=$( lscpu | grep "MHz" | tr -s ' ' | cut -d\ -f3 | cut -d'.' -f1 ) CPU_SPEED=$( lscpu | grep -m1 "MHz" | tr -s ' ' | cut -d\ -f3 || cut -d' ' -f3 | cut -d'.' -f1 )
CPU_CORE=$( lscpu | grep "^CPU(s)" | tr -s ' ' | cut -d\ -f2 ) CPU_CORE=$( lscpu | grep "^CPU(s)" | tr -s ' ' | cut -d\ -f2 || cut -d' ' -f2 )
MEM_GIG=$(( (($MEM_MEG / 1000) / 2) )) MEM_GIG=$(( (($MEM_MEG / 1000) / 2) ))
JOBS=$(( ${MEM_GIG} > ${CPU_CORE} ? ${CPU_CORE} : ${MEM_GIG} )) JOBS=$(( ${MEM_GIG} > ${CPU_CORE} ? ${CPU_CORE} : ${MEM_GIG} ))
DISK_INSTALL=`df -h . | tail -1 | tr -s ' ' | cut -d\ -f1` DISK_INSTALL=`df -h . | tail -1 | tr -s ' ' | cut -d\ -f1 || cut -d' ' -f1`
DISK_TOTAL_KB=`df . | tail -1 | awk '{print $2}'` DISK_TOTAL_KB=`df . | tail -1 | awk '{print $2}'`
DISK_AVAIL_KB=`df . | tail -1 | awk '{print $4}'` DISK_AVAIL_KB=`df . | tail -1 | awk '{print $4}'`
DISK_TOTAL=$(( $DISK_TOTAL_KB / 1048576 )) DISK_TOTAL=$(( $DISK_TOTAL_KB / 1048576 ))
...@@ -324,4 +324,4 @@ mongodconf ...@@ -324,4 +324,4 @@ mongodconf
printf '\texport PATH=${HOME}/opt/mongodb/bin:$PATH\n' printf '\texport PATH=${HOME}/opt/mongodb/bin:$PATH\n'
printf "\tcd ${HOME}/eos/build; make test\n\n" printf "\tcd ${HOME}/eos/build; make test\n\n"
return 0 return 0
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册