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://www.tp-link.com/us/support/download/omada-software-controller/
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-15 22:39:16 +02:00
$STD apt install -y jsvc
2023-06-15 11:31:31 -04:00
msg_ok "Installed Dependencies"
2025-11-20 13:01:41 +01:00
JAVA_VERSION = "21" setup_java
2026-06-22 04:45:41 +10:00
if [[ " $( arch_resolve) " == "arm64" ]] || lscpu | grep -q 'avx' ; then
2025-10-22 07:41:30 -07:00
MONGO_VERSION = "8.0" setup_mongodb
2025-02-24 14:50:09 +01:00
else
2025-11-20 13:01:41 +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 Omada, we currently only support AVX CPUs."
exit 10
2025-02-24 14:50:09 +01:00
fi
if ! dpkg -l | grep -q 'libssl1.1' ; then
2025-10-22 07:41:30 -07:00
msg_info "Installing libssl (if needed)"
2026-09-08 16:44:04 +02:00
# libssl1.1 is bullseye's last build, and the pinned filename rotted twice over:
# the point release moves on its own schedule, and bullseye left
# security.debian.org when its LTS ended. Take the newest build from whichever
# pool still carries one instead of hardcoding a name.
LIBSSL_ARCH = $( arch_resolve)
LIBSSL_URL = ""
LIBSSL_DEB = ""
for POOL in \
"https://security.debian.org/debian-security/pool/updates/main/o/openssl" \
"https://archive.debian.org/debian-security/pool/updates/main/o/openssl" \
"https://archive.debian.org/debian/pool/main/o/openssl" ; do
FOUND = $( curl -fsSL " $POOL /" | grep -oE "libssl1\.1_[^\"<>]+_ ${ LIBSSL_ARCH } \.deb" | sort -V | tail -n1 || true )
[[ -z " $FOUND " ]] && continue
# Newest across every pool, not the first hit: the security archive still
# only carries buster, whose 1.1.1n is older than bullseye's 1.1.1w.
if [[ -z " $LIBSSL_DEB " || " $( printf '%s\n%s\n' " $LIBSSL_DEB " " $FOUND " | sort -V | tail -n1) " == " $FOUND " ]] ; then
LIBSSL_DEB = " $FOUND "
LIBSSL_URL = " $POOL / $FOUND "
fi
done
if [[ -z " $LIBSSL_URL " ]] ; then
msg_error "No libssl1.1 package for ${ LIBSSL_ARCH } found in any Debian pool"
exit 1
fi
curl_download "/tmp/libssl.deb" " $LIBSSL_URL "
2025-05-28 10:54:01 +02:00
$STD dpkg -i /tmp/libssl.deb
rm -f /tmp/libssl.deb
msg_ok "Installed libssl1.1"
2025-02-24 14:50:09 +01:00
fi
2023-06-15 11:31:31 -04:00
2025-02-24 14:50:09 +01:00
msg_info "Installing Omada Controller"
2026-06-29 07:02:08 +10:00
OMADA_URL = $( curl -fsSL -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Safari/605.1.15" "https://support.omadanetworks.com/en/download/software/omada-controller/" |
2025-05-28 10:54:01 +02:00
grep -o 'https://static\.tp-link\.com/upload/software/[^"]*linux_x64[^"]*\.deb' |
head -n1)
2026-05-11 23:17:04 -07:00
OMADA_PKG = $( basename " ${ OMADA_URL } " )
2026-05-17 14:01:56 +02:00
curl_download " ${ OMADA_PKG } " " ${ OMADA_URL } "
2026-05-11 23:17:04 -07:00
$STD dpkg -i " ${ OMADA_PKG } "
rm -rf " ${ OMADA_PKG } "
2026-07-20 11:43:34 +02:00
VERSION = $( sed -n 's/.*_v\([0-9.]*\)_linux.*/\1/p' <<< " ${ OMADA_PKG } " )
2026-05-11 23:17:04 -07:00
echo " ${ VERSION } " >$HOME /.omada
2024-01-16 05:48:39 -05:00
msg_ok "Installed Omada Controller"
2023-03-22 20:48:20 -04:00
motd_ssh
2023-05-15 07:39:30 -04:00
customize
2025-11-20 13:01:41 +01:00
cleanup_lxc