Skip to content

Commit

Permalink
fix Bug 66308 - Fix incorrect RAM retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-antonyuk committed Feb 8, 2024
1 parent 0e5821d commit ff1a09f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions install-Debian/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -e

make_swap () {
DISK_REQUIREMENTS=6144; #6Gb free space
MEMORY_REQUIREMENTS=16384; #RAM ~16Gb
MEMORY_REQUIREMENTS=16000; #RAM ~16Gb

AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }');
TOTAL_MEMORY=$(free -m | grep -oP '\d+' | head -n 1);
TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1);
EXIST=$(swapon -s | awk '{ print $1 }' | { grep -x '/app_swapfile' || true; });

if [[ -z $EXIST ]] && [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ] && [ ${AVAILABLE_DISK_SPACE} -gt ${DISK_REQUIREMENTS} ]; then
Expand All @@ -25,8 +25,8 @@ command_exists () {

check_hardware () {
DISK_REQUIREMENTS=40960;
MEMORY_REQUIREMENTS=5500;
CORE_REQUIREMENTS=2;
MEMORY_REQUIREMENTS=8000;
CORE_REQUIREMENTS=4;

AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }');

Expand All @@ -35,7 +35,7 @@ check_hardware () {
exit 1;
fi

TOTAL_MEMORY=$(free -m | grep -oP '\d+' | head -n 1);
TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1);

if [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ]; then
echo "Minimal requirements are not met: need at least $MEMORY_REQUIREMENTS MB of RAM"
Expand Down
10 changes: 5 additions & 5 deletions install-RedHat/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -e

function make_swap () {
local DISK_REQUIREMENTS=6144; #6Gb free space
local MEMORY_REQUIREMENTS=16384; #RAM ~16Gb
local MEMORY_REQUIREMENTS=16000; #RAM ~16Gb

local AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }');
local TOTAL_MEMORY=$(free -m | grep -oP '\d+' | head -n 1);
local TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1);
local EXIST=$(swapon -s | awk '{ print $1 }' | { grep -x '/app_swapfile' || true; });

if [[ -z $EXIST ]] && [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ] && [ ${AVAILABLE_DISK_SPACE} -gt ${DISK_REQUIREMENTS} ]; then
Expand All @@ -21,8 +21,8 @@ function make_swap () {

check_hardware () {
DISK_REQUIREMENTS=40960;
MEMORY_REQUIREMENTS=5500;
CORE_REQUIREMENTS=2;
MEMORY_REQUIREMENTS=8000;
CORE_REQUIREMENTS=4;

AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }');

Expand All @@ -31,7 +31,7 @@ check_hardware () {
exit 1;
fi

TOTAL_MEMORY=$(free -m | grep -oP '\d+' | head -n 1);
TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1);

if [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ]; then
echo "Minimal requirements are not met: need at least $MEMORY_REQUIREMENTS MB of RAM"
Expand Down
10 changes: 5 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# You can contact Ascensio System SIA by email at [email protected]

DISK_REQUIREMENTS=40960;
MEMORY_REQUIREMENTS=5500;
CORE_REQUIREMENTS=2;
MEMORY_REQUIREMENTS=8000;
CORE_REQUIREMENTS=4;

PRODUCT="onlyoffice";
BASE_DIR="/app/$PRODUCT";
Expand Down Expand Up @@ -722,7 +722,7 @@ check_hardware () {
exit 1;
fi

TOTAL_MEMORY=$(free -m | grep -oP '\d+' | head -n 1);
TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1);

if [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ]; then
echo "Minimal requirements are not met: need at least $MEMORY_REQUIREMENTS MB of RAM"
Expand All @@ -739,10 +739,10 @@ check_hardware () {

make_swap () {
DISK_REQUIREMENTS=6144; #6Gb free space
MEMORY_REQUIREMENTS=16384; #RAM ~16Gb
MEMORY_REQUIREMENTS=16000; #RAM ~16Gb

AVAILABLE_DISK_SPACE=$(df -m / | tail -1 | awk '{ print $4 }');
TOTAL_MEMORY=$(free -m | grep -oP '\d+' | head -n 1);
TOTAL_MEMORY=$(free --mega | grep -oP '\d+' | head -n 1);
EXIST=$(swapon -s | awk '{ print $1 }' | { grep -x ${SWAPFILE} || true; });

if [[ -z $EXIST ]] && [ ${TOTAL_MEMORY} -lt ${MEMORY_REQUIREMENTS} ] && [ ${AVAILABLE_DISK_SPACE} -gt ${DISK_REQUIREMENTS} ]; then
Expand Down

0 comments on commit ff1a09f

Please sign in to comment.