mirror of
https://github.com/YunoHost-Apps/mastodon_ynh.git
synced 2024-09-03 19:46:02 +02:00
Add a check that there's a reasonable quantity of RAM+swap available
This commit is contained in:
parent
eeec0653ac
commit
78703ff4f5
1 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,12 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder"
|
|||
# TODO: remove this test, don't as password anymore, generate it and send it by email to admin with: https://github.com/YunoHost-Apps/Experimental_helpers/tree/master/send_readme_to_admin
|
||||
[[ ${#admin_pass} -gt 7 ]] || ynh_die "Password is too weak, must be longer than 7 characters"
|
||||
|
||||
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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue