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

Update upgrade

This commit is contained in:
rosbeef andino 2023-01-30 00:52:44 +00:00 committed by GitHub
parent ba245304b5
commit a1ae93792a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -218,8 +218,6 @@ ynh_add_nginx_config
# ADD SWAP IF NEEDED and not contenerized # ADD SWAP IF NEEDED and not contenerized
#================================================= #=================================================
if [ -n "$(grep 'kthreadd' /proc/2/status 2>/dev/null)" ]; then
ynh_script_progression --message="Adding swap if needed..." --weight=1 ynh_script_progression --message="Adding swap if needed..." --weight=1
total_memory=$(ynh_get_ram --total) total_memory=$(ynh_get_ram --total)
@ -227,14 +225,15 @@ if [ -n "$(grep 'kthreadd' /proc/2/status 2>/dev/null)" ]; then
if [ $total_memory -lt $memory_needed ]; then if [ $total_memory -lt $memory_needed ]; then
# Need a minimum of memory # Need a minimum of memory
if [ -n "$(grep 'kthreadd' /proc/2/status 2>/dev/null)" ]; then
swap_needed=$(($memory_needed - $total_memory)) swap_needed=$(($memory_needed - $total_memory))
ynh_script_progression --message="Adding $swap_needed Mo to swap..." ynh_script_progression --message="Adding $swap_needed Mo to swap..."
ynh_add_swap --size=$swap_needed ynh_add_swap --size=$swap_needed
fi
else else
ynh_script_progression --message="No swap will be added as you are inside a container. Please take care of having more than 2,5G memory available..." ynh_script_progression --message="No swap will be added as you are inside a container. Please take care of having more than 2,5G memory available..."
fi fi
fi
#================================================= #=================================================
# BUILD APP # BUILD APP
#================================================= #=================================================