diff options
author | Daniel Hansson <daniel@techandme.se> | 2017-06-09 17:52:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-09 17:52:37 +0300 |
commit | 3b50dd151743f111d336b88977cf0ef26b09fc24 (patch) | |
tree | be272de13f9d1257d39861febfa9c7d914455b67 /apps | |
parent | c25a257b4ca5ef3d844254bc2c3131b8f20efd36 (diff) |
make RAM and CPU check a function (#259)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/collabora.sh | 14 | ||||
-rw-r--r-- | apps/onlyoffice.sh | 14 |
2 files changed, 6 insertions, 22 deletions
diff --git a/apps/collabora.sh b/apps/collabora.sh index 75bce1aa..6335a567 100644 --- a/apps/collabora.sh +++ b/apps/collabora.sh @@ -20,17 +20,9 @@ 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 +# Test RAM size (2GB min) + CPUs (min 2) +ram_check 2 Collabora +cpu_check 2 Collabora # Check if Onlyoffice is running if [ -d "$NCPATH"/apps/onlyoffice ] diff --git a/apps/onlyoffice.sh b/apps/onlyoffice.sh index e624a3ad..63d35235 100644 --- a/apps/onlyoffice.sh +++ b/apps/onlyoffice.sh @@ -20,17 +20,9 @@ then exit 1 fi -# Test RAM size (4GB min) -mem_available="$(awk '/MemTotal/{print $2}' /proc/meminfo)" -if [ "${mem_available}" -lt 4000000 ] -then - 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 +# Test RAM size (4GB min) + CPUs (min 2) +ram_check 4 OnlyOffice +cpu_check 2 OnlyOffice # Check if Collabora is running if [ -d "$NCPATH"/apps/richdocuments ] |