From 9d999d8cacec52fb3c53ed8e5cf309bf58d6d36e Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Thu, 6 Nov 2025 09:02:17 +0100 Subject: [PATCH] Add Omada Controller install and container scripts Introduces ct/omada.sh for Proxmox container setup and install/omada-install.sh for Omada Controller installation. Scripts handle dependency installation, MongoDB and Java setup, and automate Omada Controller deployment. --- ct/omada.sh | 73 ++++++++++++++++++++++++++++++++++++++++ install/omada-install.sh | 63 ++++++++++++++++++++++++++++++++++ 2 files changed, 136 insertions(+) create mode 100644 ct/omada.sh create mode 100644 install/omada-install.sh diff --git a/ct/omada.sh b/ct/omada.sh new file mode 100644 index 000000000..576797b71 --- /dev/null +++ b/ct/omada.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 tteck +# Author: tteck (tteckster) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://www.tp-link.com/us/support/download/omada-software-controller/ + +APP="Omada" +var_tags="${var_tags:-tp-link;controller}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-3072}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/tplink ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_info "Updating MongoDB" + if lscpu | grep -q 'avx'; then + MONGO_VERSION="8.0" setup_mongodb + else + msg_warn "No AVX detected: Using older MongoDB 4.4" + MONGO_VERSION="4.4" setup_mongodb + fi + + msg_info "Checking if right Azul Zulu Java is installed" + java_version=$(java -version 2>&1 | awk -F[\"_] '/version/ {print $2}') + if [[ "$java_version" =~ ^1\.8\.* ]]; then + $STD apt remove --purge -y zulu8-jdk + $STD apt -y install zulu21-jre-headless + msg_ok "Updated Azul Zulu Java to 21" + else + msg_ok "Azul Zulu Java 21 already installed" + fi + + msg_info "Updating Omada Controller" + OMADA_URL=$(curl -fsSL "https://support.omadanetworks.com/en/download/software/omada-controller/" | + grep -o 'https://static\.tp-link\.com/upload/software/[^"]*linux_x64[^"]*\.deb' | + head -n1) + OMADA_PKG=$(basename "$OMADA_URL") + if [ -z "$OMADA_PKG" ]; then + msg_error "Could not retrieve Omada package – server may be down." + exit + fi + curl -fsSL "$OMADA_URL" -o "$OMADA_PKG" + export DEBIAN_FRONTEND=noninteractive + $STD dpkg -i "$OMADA_PKG" + rm -f "$OMADA_PKG" + msg_ok "Updated successfully!" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}https://${IP}:8043${CL}" diff --git a/install/omada-install.sh b/install/omada-install.sh new file mode 100644 index 000000000..305c9fc9e --- /dev/null +++ b/install/omada-install.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 tteck +# Author: tteck (tteckster) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://www.tp-link.com/us/support/download/omada-software-controller/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y jsvc +msg_ok "Installed Dependencies" + +msg_info "Checking CPU Features" +if lscpu | grep -q 'avx'; then + MONGODB_VERSION="8.0" + msg_ok "AVX detected: Using MongoDB 8.0" + MONGO_VERSION="8.0" setup_mongodb +else + MONGO_VERSION="4.4" setup_mongodb +fi + +msg_info "Installing Azul Zulu Java" +curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xB1998361219BD9C9" -o "/etc/apt/trusted.gpg.d/zulu-repo.asc" +curl -fsSL "https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-3_all.deb" -o zulu-repo.deb +$STD dpkg -i zulu-repo.deb +$STD apt update +$STD apt -y install zulu21-jre-headless +msg_ok "Installed Azul Zulu Java" + + +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" +fi + +msg_info "Installing Omada Controller" +OMADA_URL=$(curl -fsSL "https://support.omadanetworks.com/en/download/software/omada-controller/" | + grep -o 'https://static\.tp-link\.com/upload/software/[^"]*linux_x64[^"]*\.deb' | + head -n1) +OMADA_PKG=$(basename "$OMADA_URL") +curl -fsSL "$OMADA_URL" -o "$OMADA_PKG" +$STD dpkg -i "$OMADA_PKG" +msg_ok "Installed Omada Controller" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -rf "$OMADA_PKG" zulu-repo.deb +$STD apt -y autoremove +$STD apt -y autoclean +$STD apt -y clean +msg_ok "Cleaned"