aboutsummaryrefslogtreecommitdiff
path: root/scripts/install
diff options
context:
space:
mode:
authoranmol26s <5068843+anmol26s@users.noreply.github.com>2019-03-20 01:34:28 +0530
committerGitHub <noreply@github.com>2019-03-20 01:34:28 +0530
commit4feccb3125c7bd82a910aff06e674536107e6310 (patch)
treeb337f4a67052d91e4c41cf91a40f9b078b831549 /scripts/install
parentcc4c8e73e6e62e888ff1a8793276e3e04e93a8bd (diff)
parentedf6ab38147cafd2ff856130d4e0b22424199266 (diff)
downloadmastodon_ynh-4feccb3125c7bd82a910aff06e674536107e6310.tar.gz
mastodon_ynh-4feccb3125c7bd82a910aff06e674536107e6310.tar.bz2
mastodon_ynh-4feccb3125c7bd82a910aff06e674536107e6310.zip
Merge pull request #129 from alexAubin/patch-1
Add a check that there's a reasonable quantity of RAM+swap available
Diffstat (limited to 'scripts/install')
-rw-r--r--scripts/install7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/install b/scripts/install
index 3680b03..0cb4675 100644
--- a/scripts/install
+++ b/scripts/install
@@ -40,6 +40,13 @@ app=$YNH_APP_INSTANCE_NAME
final_path=/var/www/$app
test ! -e "$final_path" || ynh_die "This path already contains a folder"
+# TODO : to be factorized into a helper someday ? ;)
+MEM=$(free | grep "^Mem" | awk '{print $2}')
+SWAP=$(free | grep "^Swap" | awk '{print $2}')
+TOTAL_MEM_AND_SWAP=$(( ( $MEM+$SWAP ) / 1024 )) # In MB
+
+[[ $TOTAL_MEM_AND_SWAP -gt 2500 ]] || ynh_die "You need at least 2500 Mo of RAM+Swap to install Mastodon. Please consult the README to learn how to add swap."
+
# Normalize the url path syntax
path_url=$(ynh_normalize_url_path $path_url)