From 23328640e8b83c7a541a699946aad43a2eff6b19 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Sat, 1 Jul 2023 17:04:46 +0200 Subject: [PATCH] Remove free if exists --- debian/post.install.ovh.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/debian/post.install.ovh.sh b/debian/post.install.ovh.sh index 2841a26..ef68547 100755 --- a/debian/post.install.ovh.sh +++ b/debian/post.install.ovh.sh @@ -35,10 +35,12 @@ apt update apt --assume-yes install -- wget # Remove last partition with all free space -umount /mnt/free -lvremove --force /dev/mapper/vg-free -/bin/rmdir -- /mnt/free -/bin/sed --in-place -- '/\/mnt\/free/d' /etc/fstab +if [ -d /mnt/free ]; then + umount /mnt/free + test -f /dev/mapper/vg-free && lvremove --force /dev/mapper/vg-free + /bin/rmdir -- /mnt/free + /bin/sed --in-place -- '/\/mnt\/free/d' /etc/fstab +fi # Allow root connection with password /bin/sed --in-place -- 's/\(^\|^\#\)\(PermitRootLogin\).*/\2 yes/g' /etc/ssh/sshd_config