mirror of
https://github.com/YunoHost-Apps/photoprism_ynh.git
synced 2024-09-03 19:56:41 +02:00
Swap
This commit is contained in:
parent
4b33398512
commit
b8cf96e35a
2 changed files with 10 additions and 3 deletions
|
@ -68,9 +68,9 @@ ynh_app_setting_set --app=$app --key=language --value=$language_key
|
||||||
total_memory=$(ynh_get_ram --total)
|
total_memory=$(ynh_get_ram --total)
|
||||||
swap_needed=0
|
swap_needed=0
|
||||||
|
|
||||||
# Need at least 2Go of RAM
|
# Need at least 1.5Go of RAM to build and run
|
||||||
if [ $total_memory -lt 3072 ]; then
|
if [ $total_memory -lt 1536 ]; then
|
||||||
swap_needed=$((3072 - total_memory))
|
swap_needed=$((1536 - total_memory))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $swap_needed -gt 0 ]; then
|
if [ $swap_needed -gt 0 ]; then
|
||||||
|
|
|
@ -105,6 +105,13 @@ then
|
||||||
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
ynh_exec_warn_less yunohost firewall disallow TCP $port
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# REMOVE SWAP IF NEEDED
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Removing swap if needed..."
|
||||||
|
|
||||||
|
ynh_del_swap
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SPECIFIC REMOVE
|
# SPECIFIC REMOVE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
Loading…
Add table
Reference in a new issue