diff options
author | Daniel Hansson <github@hanssonit.se> | 2020-06-04 00:47:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-04 00:47:16 +0300 |
commit | fa4f6631d2fa49cac65742ce483e65adbead7d62 (patch) | |
tree | 8cf3407f0f7db7dd8c518937e9fca09e12551d11 /nextcloud_install_production.sh | |
parent | 8c47858905de3a2503f0b6c6bbfec800cdaf390a (diff) |
use until instead of while
Diffstat (limited to 'nextcloud_install_production.sh')
-rw-r--r-- | nextcloud_install_production.sh | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index eb54ae5e..c9eec121 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -99,18 +99,16 @@ fi if grep -q "LVM" /etc/fstab then # Resize LVM (live installer is &%ยค%/! - print_text_in_color "$ICyan" "Extending LVM..." + print_text_in_color "$ICyan" "Extending LVM, this may take a long time..." lvextend -l 100%FREE --resizefs /dev/ubuntu-vg/ubuntu-lv - + # Backup solution - while lvextend -L +1M /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 + until lvextend -L +1M /dev/ubuntu-vg/ubuntu-lv | grep -qr "Insufficient free space" do - if lvextend -L +1M /dev/ubuntu-vg/ubuntu-lv | grep -q "Insufficient free space" - then - resize2fs /dev/ubuntu-vg/ubuntu-lv - break - fi + lvdisplay | grep "Size" | awk '{print $3}' + lvextend -L +1G /dev/ubuntu-vg/ubuntu-lv >/dev/null 2>&1 done + resize2fs /dev/ubuntu-vg/ubuntu-lv fi # Check if it's a clean server |