diff options
author | Daniel Hansson <github@hanssonit.se> | 2020-06-04 02:24:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-04 02:24:35 +0300 |
commit | 03a8a67b4d3438f0d7a51f4c6c90c1afdf5916ba (patch) | |
tree | f5d7fd21e9571c66f9a4efd7250c083eceb3cddc /nextcloud_install_production.sh | |
parent | fa4f6631d2fa49cac65742ce483e65adbead7d62 (diff) |
revert to while and make it more stable
Diffstat (limited to 'nextcloud_install_production.sh')
-rw-r--r-- | nextcloud_install_production.sh | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index c9eec121..2cd2b52b 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -103,12 +103,23 @@ then lvextend -l 100%FREE --resizefs /dev/ubuntu-vg/ubuntu-lv # Backup solution - until lvextend -L +1M /dev/ubuntu-vg/ubuntu-lv | grep -qr "Insufficient free space" - do - lvdisplay | grep "Size" | awk '{print $3}' - lvextend -L +1G /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + while lvdisplay | grep "Size" | awk '{print $3}' && lvextend -L +1M /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + do + if ! lvextend -L +10G /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + then + if ! lvextend -L +1G /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + then + if ! lvextend -L +100M /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + then + if ! lvextend -L +1M /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + then + resize2fs /dev/ubuntu-vg/ubuntu-lv + break + fi + fi + fi + fi done - resize2fs /dev/ubuntu-vg/ubuntu-lv fi # Check if it's a clean server |