aboutsummaryrefslogtreecommitdiff
path: root/scripts/install
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2019-04-11 20:24:25 +0200
committerGitHub <noreply@github.com>2019-04-11 20:24:25 +0200
commit90a03313093f3e9eecf10115e1b6fddc3cb7ea89 (patch)
tree473830a51c859835cc3cc1228cbe559a8dd6aab3 /scripts/install
parentdf2e2fb226a6b08f70dfdaff32abde1338d1a292 (diff)
parentedf6ab38147cafd2ff856130d4e0b22424199266 (diff)
downloadmastodon_ynh-90a03313093f3e9eecf10115e1b6fddc3cb7ea89.tar.gz
mastodon_ynh-90a03313093f3e9eecf10115e1b6fddc3cb7ea89.tar.bz2
mastodon_ynh-90a03313093f3e9eecf10115e1b6fddc3cb7ea89.zip
Merge pull request #3 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 e62b078..f68c97d 100644
--- a/scripts/install
+++ b/scripts/install
@@ -44,6 +44,13 @@ ynh_print_info "Validating installation parameters..."
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)