diff --git a/plugins/openresty/install.sh b/plugins/openresty/install.sh index 78e4d6b5c..7a1fc76c2 100755 --- a/plugins/openresty/install.sh +++ b/plugins/openresty/install.sh @@ -35,8 +35,13 @@ Install_openresty() cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` fi - if [ "$cpuCore" -gt "1" ];then - cpuCore=`echo "$cpuCore" | awk '{printf("%.f",($1)*0.8)}'` + 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 # ----- cpu end ------ diff --git a/plugins/php/versions/53/install.sh b/plugins/php/versions/53/install.sh index a9f4862eb..b2c66938a 100755 --- a/plugins/php/versions/53/install.sh +++ b/plugins/php/versions/53/install.sh @@ -65,14 +65,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/54/install.sh b/plugins/php/versions/54/install.sh index 14b2c63f1..0e23981f6 100755 --- a/plugins/php/versions/54/install.sh +++ b/plugins/php/versions/54/install.sh @@ -57,14 +57,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/55/install.sh b/plugins/php/versions/55/install.sh index 15657fb1b..e067c6754 100755 --- a/plugins/php/versions/55/install.sh +++ b/plugins/php/versions/55/install.sh @@ -56,14 +56,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/56/install.sh b/plugins/php/versions/56/install.sh index 757962717..af7e2ee7e 100755 --- a/plugins/php/versions/56/install.sh +++ b/plugins/php/versions/56/install.sh @@ -56,14 +56,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/70/install.sh b/plugins/php/versions/70/install.sh index 74c3493b2..06c3f9470 100755 --- a/plugins/php/versions/70/install.sh +++ b/plugins/php/versions/70/install.sh @@ -56,14 +56,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/71/install.sh b/plugins/php/versions/71/install.sh index db4af66ac..b4542cb8e 100755 --- a/plugins/php/versions/71/install.sh +++ b/plugins/php/versions/71/install.sh @@ -53,14 +53,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/72/install.sh b/plugins/php/versions/72/install.sh index 68c6b2c58..e49e08cc2 100755 --- a/plugins/php/versions/72/install.sh +++ b/plugins/php/versions/72/install.sh @@ -55,14 +55,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/73/install.sh b/plugins/php/versions/73/install.sh index 3d7ec4024..3467376c0 100755 --- a/plugins/php/versions/73/install.sh +++ b/plugins/php/versions/73/install.sh @@ -69,14 +69,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/74/install.sh b/plugins/php/versions/74/install.sh index 8f68710af..82430997a 100755 --- a/plugins/php/versions/74/install.sh +++ b/plugins/php/versions/74/install.sh @@ -85,14 +85,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/80/install.sh b/plugins/php/versions/80/install.sh index 869683e4e..7a3369448 100755 --- a/plugins/php/versions/80/install.sh +++ b/plugins/php/versions/80/install.sh @@ -76,14 +76,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/81/install.sh b/plugins/php/versions/81/install.sh index d48a39c21..56c4237d4 100755 --- a/plugins/php/versions/81/install.sh +++ b/plugins/php/versions/81/install.sh @@ -70,14 +70,14 @@ 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 [ "${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)}'` diff --git a/plugins/php/versions/82/install.sh b/plugins/php/versions/82/install.sh index f1004623b..f199b1b49 100755 --- a/plugins/php/versions/82/install.sh +++ b/plugins/php/versions/82/install.sh @@ -64,14 +64,14 @@ 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 [ "${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)}'`