From c961dffcf13d509972ea8987453f13d542622695 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:28:30 +0100 Subject: [PATCH] Fix base package pre-installation check in UniFi VM script Update the logic for detecting errors during base package pre-installation in unifi-os-server-vm.sh by checking for 'error' in the output. Also correct URLs in cloud-init.func to use the correct repository path. --- misc/cloud-init.func | 4 ++-- vm/unifi-os-server-vm.sh | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/misc/cloud-init.func b/misc/cloud-init.func index 3f6f197bf..17f4fefc5 100644 --- a/misc/cloud-init.func +++ b/misc/cloud-init.func @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Copyright (c) 2021-2025 community-scripts ORG # Author: community-scripts ORG -# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/branch/main/LICENSE +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/branch/main/LICENSE # Revision: 1 # ============================================================================== @@ -17,7 +17,7 @@ # - Cloud-Init status monitoring and waiting # # Usage: -# source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/cloud-init.func) +# source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/cloud-init.func) # setup_cloud_init "$VMID" "$STORAGE" "$HN" "yes" # # Compatible with: Debian, Ubuntu, and all Cloud-Init enabled distributions diff --git a/vm/unifi-os-server-vm.sh b/vm/unifi-os-server-vm.sh index 4efa572ce..af2f7173a 100644 --- a/vm/unifi-os-server-vm.sh +++ b/vm/unifi-os-server-vm.sh @@ -771,13 +771,11 @@ SVCEOF" >/dev/null virt-customize -q -a "${FILE}" --run-command "systemctl enable unifi-firstboot.service" >/dev/null # Try to install base packages during image customization (faster startup if it works) -UNIFI_PREINSTALLED="no" - msg_info "Pre-installing base packages (qemu-guest-agent, podman, curl)" -if virt-customize -a "${FILE}" --install qemu-guest-agent,curl,ca-certificates,podman,uidmap,slirp4netns >/dev/null 2>&1; then - msg_ok "Pre-installed base packages (UniFi OS will install on first boot)" -else +if virt-customize -a "${FILE}" --install qemu-guest-agent,curl,ca-certificates,podman,uidmap,slirp4netns 2>&1 | grep -q "error"; then msg_info "Pre-installation not possible, packages will install on first boot" +else + msg_ok "Pre-installed base packages (UniFi OS will install on first boot)" fi # Add auto-login if Cloud-Init is disabled