Test new post-install script for OVH template

This commit is contained in:
gardouille 2023-06-26 16:39:42 +02:00
parent f51aae7bc2
commit 15453a7972
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 23 additions and 0 deletions

23
debian/post.install.ovh.sh vendored Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
# Update repositories
apt update
# Install few dependencies
apt --assume-yes install -- wget
# Remove last partition with all free space
umount /dev/sys/free
lvremove --force /dev/sys/free
/bin/rmdir --force -- /mnt/free
/bin/sed --in-place -- '/lv_free/d' /etc/fstab
# Allow root connection with password
/bin/sed --in-place -- 's/\(^\|^\#\)\(PermitRootLogin\).*/\2 yes/g' /etc/ssh/sshd_config
# Download and uncompress latecommand archive
wget --quiet --output-document=/tmp/latecommand.tar.gz -- "https://git.ipr.univ-rennes1.fr/cellinfo/tftpboot/raw/branch/master/scripts/latecommand.tar.gz"
tar xzf /tmp/latecommand.tar.gz -C /tmp/
# Run dedicated script
## Source /etc/os-release to get Debian codename
. /etc/os-release
/bin/sh /tmp/latecommand/post."${VERSION_CODENAME:=bookworm}".sh