Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/vm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDaniel Hansson <daniel@techandme.se>2017-06-09 17:52:37 +0300
committerGitHub <noreply@github.com>2017-06-09 17:52:37 +0300
commit3b50dd151743f111d336b88977cf0ef26b09fc24 (patch)
treebe272de13f9d1257d39861febfa9c7d914455b67 /apps
parentc25a257b4ca5ef3d844254bc2c3131b8f20efd36 (diff)
make RAM and CPU check a function (#259)
Diffstat (limited to 'apps')
-rw-r--r--apps/collabora.sh14
-rw-r--r--apps/onlyoffice.sh14
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 ]