mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
29 lines
680 B
Bash
Executable file
29 lines
680 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
. /usr/share/yunohost/helpers
|
|
|
|
do_pre_regen() {
|
|
}
|
|
|
|
do_post_regen() {
|
|
|
|
swapfile_enabled="$(yunohost settings get 'swap.swapfile.swapfile_enabled')"
|
|
swapfile_size="$(yunohost settings get 'swap.swapfile.swapfile_size')"
|
|
|
|
if [ "${swapfile_enabled}" == "True" ]; then
|
|
# If a swapfile is requested
|
|
if [ $(stat -c%s /swap_file) -ne $swapfile_size ]; then
|
|
# Let's delete it first if it is not of the requested size
|
|
ynh_del_swap
|
|
fi
|
|
# create the swapfile
|
|
ynh_add_swap --size=$swapfile_size
|
|
else
|
|
# If not, make sure it is deleted
|
|
ynh_del_swap
|
|
fi
|
|
}
|
|
|
|
do_$1_regen ${@:2}
|