diff options
author | Daniel Hansson <daniel@techandme.se> | 2017-06-09 16:34:26 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-09 16:34:26 +0300 |
commit | c25a257b4ca5ef3d844254bc2c3131b8f20efd36 (patch) | |
tree | a717d053e0b61959480bc68199f4b70d8a41f00d /apps | |
parent | a5dae67851535d647e66521f9224245256b935a9 (diff) |
change RAM check + add RAM check to more scripts (#258)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/collabora.sh | 12 | ||||
-rw-r--r-- | apps/onlyoffice.sh | 10 |
2 files changed, 19 insertions, 3 deletions
diff --git a/apps/collabora.sh b/apps/collabora.sh index faf97fbb..75bce1aa 100644 --- a/apps/collabora.sh +++ b/apps/collabora.sh @@ -20,6 +20,18 @@ then exit 1 fi +# Test RAM size (2GB min) +mem_available="$(awk '/MemTotal/{print $2}' /proc/meminfo)" +if [ "${mem_available}" -lt 2000000 ] +then + echo "Error: 2GB RAM required for Collabora!" >&2 + echo "Current RAM is: ("$((mem_available/1024))" MiB)" >&2 + sleep 3 + exit 1 +else + echo "Memory: OK ("$((mem_available/1024))" MiB)" +fi + # Check if Onlyoffice is running if [ -d "$NCPATH"/apps/onlyoffice ] then diff --git a/apps/onlyoffice.sh b/apps/onlyoffice.sh index c71467d9..e624a3ad 100644 --- a/apps/onlyoffice.sh +++ b/apps/onlyoffice.sh @@ -20,12 +20,16 @@ then exit 1 fi -# Check configured RAM (needs at least 4 GB) -if [ "$(awk '/MemTotal/{print $2}' /proc/meminfo)" -lt "4194304" ] +# Test RAM size (4GB min) +mem_available="$(awk '/MemTotal/{print $2}' /proc/meminfo)" +if [ "${mem_available}" -lt 4000000 ] then - echo "You need at least 4 GB RAM for OnlyOffice" + echo "Error: 4GB RAM required for OnlyOffice!" >&2 + echo "Current RAM is: ("$((mem_available/1024))" MiB)" >&2 sleep 3 exit 1 +else + echo "Memory: OK ("$((mem_available/1024))" MiB)" fi # Check if Collabora is running |