mirror of
https://github.com/YunoHost-Apps/photoprism_ynh.git
synced 2024-09-03 19:56:41 +02:00
Update ynh_add_swap
This commit is contained in:
parent
b9cc97ca04
commit
6de05cbe22
1 changed files with 2 additions and 0 deletions
|
@ -48,9 +48,11 @@ ynh_add_swap () {
|
||||||
# If there's enough space for a swap, and no existing swap here
|
# If there's enough space for a swap, and no existing swap here
|
||||||
if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ]
|
if [ $swap_size -ne 0 ] && [ ! -e /swap_$app ]
|
||||||
then
|
then
|
||||||
|
echo "I'm in !"
|
||||||
# Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case
|
# Preallocate space for the swap file, fallocate may sometime not be used, use dd instead in this case
|
||||||
if ! fallocate -l ${swap_size}K /swap_$app
|
if ! fallocate -l ${swap_size}K /swap_$app
|
||||||
then
|
then
|
||||||
|
echo "I'm also in !"
|
||||||
dd if=/dev/zero of=/swap_$app bs=1024 count=${swap_size}
|
dd if=/dev/zero of=/swap_$app bs=1024 count=${swap_size}
|
||||||
fi
|
fi
|
||||||
chmod 0600 /swap_$app
|
chmod 0600 /swap_$app
|
||||||
|
|
Loading…
Add table
Reference in a new issue