2023-03-22 20:48:20 -04:00
#!/usr/bin/env bash
2026-01-06 13:28:12 +01:00
# Copyright (c) 2021-2026 tteck
2023-03-22 20:48:20 -04:00
# Author: tteck (tteckster)
2025-03-04 17:54:20 +01:00
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://ui.com/download/unifi
2023-03-22 20:48:20 -04:00
2025-03-24 14:20:56 +01:00
source /dev/stdin <<< " $FUNCTIONS_FILE_PATH "
2023-03-22 20:48:20 -04:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
2025-10-09 19:43:23 +02:00
$STD apt install -y apt-transport-https
2026-02-13 09:24:13 +01:00
curl -fsSL "https://dl.ui.com/unifi/unifi-repo.gpg" -o "/usr/share/keyrings/unifi-repo.gpg"
cat <<EOF | sudo tee /etc/apt/sources.list.d/100-ubnt-unifi.sources >/dev/null
Types: deb
URIs: https://www.ui.com/downloads/unifi/debian
Suites: stable
Components: ubiquiti
Architectures: amd64
Signed-By: /usr/share/keyrings/unifi-repo.gpg
EOF
$STD apt update
2023-03-22 20:48:20 -04:00
msg_ok "Installed Dependencies"
2025-12-21 23:13:46 +01:00
JAVA_VERSION = "21" setup_java
if lscpu | grep -q 'avx' ; then
MONGO_VERSION = "8.0" setup_mongodb
2024-11-27 06:53:44 -08:00
else
2025-12-21 23:13:46 +01:00
msg_error "No AVX detected (CPU-Flag)! We have discontinued support for this. You are welcome to try it manually with a Debian LXC, but due to the many issues with Unifi, we currently only support AVX CPUs."
exit 10
fi
if ! dpkg -l | grep -q 'libssl1.1' ; then
msg_info "Installing libssl (if needed)"
curl -fsSL "https://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1w-0+deb11u4_amd64.deb" -o "/tmp/libssl.deb"
$STD dpkg -i /tmp/libssl.deb
rm -f /tmp/libssl.deb
msg_ok "Installed libssl1.1"
2024-11-27 06:53:44 -08:00
fi
2023-05-07 10:39:56 -04:00
2024-03-20 14:55:27 -04:00
msg_info "Installing UniFi Network Server"
2025-10-09 19:43:23 +02:00
$STD apt install -y unifi
2024-03-20 14:55:27 -04:00
msg_ok "Installed UniFi Network Server"
2023-03-22 20:48:20 -04:00
motd_ssh
2023-05-15 07:39:30 -04:00
customize
2025-11-22 17:27:13 +01:00
cleanup_lxc