#!/bin/bash # Section: setup logging LOG_FILE="/var/log/maxcloud.log" exec > >(tee -a "$LOG_FILE") 2>&1 # Section: cleanup repository rm -f /etc/apt/sources.list.d/* echo "" > /etc/apt/sources.list # Section: Add new repository cat << EOF > /etc/apt/sources.list.d/ceph.sources Types: deb URIs: http://download.proxmox.com/debian/ceph-squid Suites: trixie Components: no-subscription Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg EOF cat << EOF > /etc/apt/sources.list.d/pve-enterprise.sources Types: deb URIs: http://download.proxmox.com/debian/pve Suites: trixie Components: pve-no-subscription Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg EOF cat << EOF > /etc/apt/sources.list.d/debian.sources Types: deb deb-src URIs: https://mr.heru.id/debian Suites: trixie trixie-updates trixie-backports Components: main contrib non-free non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg Types: deb deb-src URIs: https://mr.heru.id/debian-security Suites: trixie-security Components: main contrib non-free non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg EOF # Section: bootsplash wget -q http://image.maxcloud.id/bootsplash.jpg -O /usr/share/qemu-server/bootsplash.jpg cat << 'EOF' > /etc/apt/apt.conf.d/90custom-bootsplash DPkg::Post-Invoke { "wget -q http://image.maxcloud.id/bootsplash.jpg -O /usr/share/qemu-server/bootsplash.jpg && chmod 644 /usr/share/qemu-server/bootsplash.jpg"; }; EOF # Section: storage swapoff -a lvremove pve/swap -y cat << EOF > /etc/pve/storage.cfg dir: local path /var/lib/vz content images,vztmpl,iso EOF pvesm status lvremove pve/data -y lvextend -l +100%FREE pve/root sed -i '/swap/d' /etc/fstab resize2fs /dev/pve/root # Section: update and upgrade echo -n "Do you want to update/upgrade to the latest version? (y/N): " > /dev/tty read -r REPLY < /dev/tty case "$REPLY" in [Yy]*) apt update && DEBIAN_FRONTEND=noninteractive apt install jq -y && DEBIAN_FRONTEND=noninteractive apt upgrade -y ;; esac