Remove free if exists

This commit is contained in:
gardouille 2023-07-01 17:04:46 +02:00
parent c14cc7a7a1
commit 23328640e8
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 6 additions and 4 deletions

View File

@ -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