Update install.sh

This commit is contained in:
midoks 2022-08-01 13:02:21 +08:00
parent 1d1cd31f5a
commit 876957693e
1 changed files with 8 additions and 2 deletions

View File

@ -38,18 +38,24 @@ Install_mysql()
touch /var/log/mariadb/mariadb.log
fi
# ----- cpu start ------
if [ -z "${cpuCore}" ]; then
cpuCore="1"
fi
if [ -f /proc/cpuinfo ];then
cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l`
fi
MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}')
if [ "${MEM_INFO}" != "0" ];then
if [ "${cpuCore}" -lt "${MEM_INFO}" ];then
if [ "${cpuCore}" != "1" ] &&& [ "${MEM_INFO}" != "0" ];then
if [ "${cpuCore}" -gt "${MEM_INFO}" ];then
cpuCore="${MEM_INFO}"
fi
else
cpuCore="1"
fi
# ----- cpu end ------
cd $serverPath/mdserver-web/plugins/mysql/lib && /bin/bash rpcgen.sh