1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/mastodon_ynh.git synced 2024-09-03 19:46:02 +02:00

Update install

This commit is contained in:
yalh76 2019-04-12 13:54:10 +02:00
parent 8b342cce12
commit 0494ace9af

View file

@ -44,13 +44,16 @@ 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
if [ "$admin" != "package_checker" ]
then
# 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."
[[ $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."
fi
# Normalize the url path syntax
path_url=$(ynh_normalize_url_path $path_url)