From d49dd9f2ac09d7e13e7ec4c14f4340c7287dc2c8 Mon Sep 17 00:00:00 2001 From: midoks Date: Tue, 25 Oct 2022 03:37:48 +0800 Subject: [PATCH] Update install.sh --- plugins/mysql/versions/8.0/install.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/mysql/versions/8.0/install.sh b/plugins/mysql/versions/8.0/install.sh index 6c0aeffd0..059208f28 100755 --- a/plugins/mysql/versions/8.0/install.sh +++ b/plugins/mysql/versions/8.0/install.sh @@ -81,14 +81,14 @@ Install_mysql() cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` fi - # MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') - # if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then - # if [ "${cpuCore}" -gt "${MEM_INFO}" ];then - # cpuCore="${MEM_INFO}" - # fi - # else - # cpuCore="1" - # fi + MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') + if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi + else + cpuCore="1" + fi if [ "$cpuCore" -gt "1" ];then cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'`