From 9c1ddbbeb8685aba255282a0baf4b63d5cb558f5 Mon Sep 17 00:00:00 2001 From: Jordan Milne Date: Thu, 13 Nov 2014 23:36:18 -0400 Subject: [PATCH] Warn during installation if total memory is below 2GB --- install-reddit.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/install-reddit.sh b/install-reddit.sh index 135c5871e..5c26aff5b 100755 --- a/install-reddit.sh +++ b/install-reddit.sh @@ -82,6 +82,15 @@ if [ "$DISTRIB_ID" != "Ubuntu" -o "$DISTRIB_RELEASE" != "12.04" ]; then exit 1 fi +if [[ "2000000" -gt $(awk '/MemTotal/{print $2}' /proc/meminfo) ]]; then + LOW_MEM_PROMPT="reddit requires at least 2GB of memory to work properly, continue anyway? [y/n] " + read -er -n1 -p "$LOW_MEM_PROMPT" response + if [[ "$response" != "y" ]]; then + echo "Quitting." + exit 1 + fi +fi + ############################################################################### # Install prerequisites ###############################################################################