From 204fabb90066981f0b26bf1f93d4cd8b720d678c Mon Sep 17 00:00:00 2001 From: Blackwhitebear8 Date: Tue, 10 Dec 2024 10:15:58 +0100 Subject: [PATCH] Update create.sh --- create.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/create.sh b/create.sh index 233ddfd..e86b151 100755 --- a/create.sh +++ b/create.sh @@ -123,7 +123,25 @@ DISKTYPE=$(pvesm status | awk -v storage="$STORAGE" 'NR>1 && $1 == storage {prin # Pas de image aan case $OSKEUZE in 1|2|3|4) # Debian en Ubuntu - virt-customize --install qemu-guest-agent,htop,curl,avahi-daemon,console-setup,cron,cifs-utils,mtr,bash-completion,bind9-utils,lsof,mc,mlocate,screen,sysstat,tmux,wget,zabbix-agent -a /tmp/"$IMAGE_NAME" + virt-customize --install qemu-guest-agent,htop,curl,avahi-daemon,console-setup,cron,cifs-utils,mtr,bash-completion,bind9-utils,lsof,mc,mlocate,screen,sysstat,tmux,wget -a /tmp/"$IMAGE_NAME" + virt-customize --run-command "apt install qemu-guest-agent -y" -a /tmp/"$IMAGE_NAME" + virt-customize --run-command "systemctl enable --now qemu-guest-agent" -a /tmp/"$IMAGE_NAME" + + case $SSH_KEYS_PATH in + '') # leeg + virt-customize -a /tmp/"$IMAGE_NAME" \ + --run-command 'sed -i "s/^#PasswordAuthentication yes/PasswordAuthentication yes/" /etc/ssh/sshd_config' \ + --run-command 'sed -i "s/^PasswordAuthentication no/PasswordAuthentication yes/" /etc/ssh/sshd_config' \ + --run-command 'systemctl restart sshd' + ;; + /tmp/temporary_ssh_key.pub) # iets + ;; + esac + + virt-customize -a /tmp/"$IMAGE_NAME" --truncate /etc/machine-id --truncate /var/lib/dbus/machine-id + ;; + 4) # Ubuntu 24.04 heeft weer breaking changes..... + virt-customize --install qemu-guest-agent,htop,curl,avahi-daemon,console-setup,cron,cifs-utils,mtr,bash-completion,bind9-utils,lsof,mc,plocate,screen,sysstat,tmux,wget -a /tmp/"$IMAGE_NAME" virt-customize --run-command "apt install qemu-guest-agent -y" -a /tmp/"$IMAGE_NAME" virt-customize --run-command "systemctl enable --now qemu-guest-agent" -a /tmp/"$IMAGE_NAME" @@ -142,7 +160,7 @@ case $OSKEUZE in ;; 5) # RHEL virt-customize --install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -a /tmp/"$IMAGE_NAME" - virt-customize --install qemu-guest-agent,htop,curl,cifs-utils,firewalld,mtr,bash-completion,bind-utils,lsof,mc,mlocate,perl,perl-Date-Calc,perl-Data-Dumper,perl-Getopt-Long,perl-libs,screen,sysstat,tmux,wget,zabbix-agent -a /tmp/"$IMAGE_NAME" + virt-customize --install qemu-guest-agent,htop,curl,cifs-utils,firewalld,mtr,bash-completion,bind-utils,lsof,mc,mlocate,perl,perl-Date-Calc,perl-Data-Dumper,perl-Getopt-Long,perl-libs,screen,sysstat,tmux,wget -a /tmp/"$IMAGE_NAME" virt-customize --selinux-relabel -a /tmp/"$IMAGE_NAME" virt-customize --run-command "systemctl enable --now firewalld" -a /tmp/"$IMAGE_NAME" virt-customize --run-command "systemctl enable --now qemu-guest-agent" -a /tmp/"$IMAGE_NAME"