From 1833a68cfd494741a0361b7fbe21795a110b1e39 Mon Sep 17 00:00:00 2001 From: Christophe JEANNEROT Date: Sat, 21 Feb 2026 18:23:13 +0100 Subject: [PATCH] Update unifi-os.sh --- unifi-os.sh | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/unifi-os.sh b/unifi-os.sh index 3e0a887..daa5360 100644 --- a/unifi-os.sh +++ b/unifi-os.sh @@ -292,6 +292,35 @@ write_files: UNIFI_JVM_INIT_HEAP_SIZE=1024M UNIFI_JVM_MAX_HEAP_SIZE=2048M + - path: /usr/local/sbin/install-unifi.sh + permissions: "0755" + content: | + #!/usr/bin/env bash + set -euo pipefail + + export DEBIAN_FRONTEND=noninteractive + + apt-get update + apt-get install -y ca-certificates apt-transport-https wget gnupg + + # Repo UniFi (source officielle) + echo 'deb [ arch=amd64,arm64 ] https://www.ui.com/downloads/unifi/debian stable ubiquiti' \ + > /etc/apt/sources.list.d/100-ubnt-unifi.list + + # GPG key (méthode recommandée officielle) + wget -qO /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg + + # Certains cas nécessitent d'accepter un changement ReleaseInfo + apt-get update --allow-releaseinfo-change || apt-get update + + # (Optionnel mais utile en VM headless) Entropie + apt-get install -y haveged || true + systemctl enable --now haveged || true + + # Installation UniFi Network Application + apt-get install -y unifi + + systemctl enable --now unifi runcmd: @@ -312,14 +341,9 @@ runcmd: # Agent Proxmox - systemctl enable qemu-guest-agent || true - systemctl start qemu-guest-agent || true - - # Install UNIFI OS - - curl -fsSL https://dl.ui.com/unifi/unifi-repo.gpg | gpg --dearmor -o /usr/share/keyrings/unifi.gpg - - echo "deb [signed-by=/usr/share/keyrings/unifi.gpg] https://www.ui.com/downloads/unifi/debian stable ubiquiti" > /etc/apt/sources.list.d/100-ubnt-unifi.list - - apt-get update - - apt-get install -y unifi - - systemctl enable unifi - - systemctl start unifi + + # Install UNIFI + - /usr/local/sbin/install-unifi.sh EOF