2023-03-22 20:48:20 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2025-01-01 13:37:29 +01:00
|
|
|
# Copyright (c) 2021-2025 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
|
|
|
|
|
|
|
source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
|
|
|
|
color
|
|
|
|
verb_ip6
|
|
|
|
catch_errors
|
|
|
|
setting_up_container
|
|
|
|
network_check
|
|
|
|
update_os
|
|
|
|
|
|
|
|
msg_info "Installing Dependencies"
|
2025-02-24 14:50:09 +01:00
|
|
|
$STD apt-get install -y curl sudo mc gnupg jsvc
|
2023-06-15 11:31:31 -04:00
|
|
|
msg_ok "Installed Dependencies"
|
|
|
|
|
2025-02-24 14:50:09 +01:00
|
|
|
msg_info "Checking CPU Features"
|
|
|
|
if lscpu | grep -q 'avx'; then
|
|
|
|
USE_AVX=true
|
2025-02-25 08:42:48 +01:00
|
|
|
MONGODB_VERSION="7.0"
|
2025-02-25 08:44:53 +01:00
|
|
|
msg_ok "AVX detected: Using MongoDB 7.0"
|
2025-02-24 14:50:09 +01:00
|
|
|
else
|
|
|
|
USE_AVX=false
|
|
|
|
MONGODB_VERSION="4.4"
|
2025-02-25 08:44:53 +01:00
|
|
|
msg_error "No AVX detected: TP-Link Canceled Support for Old MongoDB for Debian 12\n https://www.tp-link.com/baltic/support/faq/4160/"
|
|
|
|
exit 1
|
2025-02-24 14:50:09 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
msg_info "Installing Azul Zulu Java"
|
2023-07-08 12:21:50 -04:00
|
|
|
wget -qO /etc/apt/trusted.gpg.d/zulu-repo.asc "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xB1998361219BD9C9"
|
2023-06-15 11:31:31 -04:00
|
|
|
wget -q https://cdn.azul.com/zulu/bin/zulu-repo_1.0.0-3_all.deb
|
2023-07-08 12:21:50 -04:00
|
|
|
$STD dpkg -i zulu-repo_1.0.0-3_all.deb
|
2023-06-15 11:31:31 -04:00
|
|
|
$STD apt-get update
|
|
|
|
$STD apt-get -y install zulu8-jdk
|
2025-02-24 14:50:09 +01:00
|
|
|
msg_ok "Installed Azul Zulu Java"
|
|
|
|
|
|
|
|
msg_info "Installing libssl (if needed)"
|
|
|
|
if ! dpkg -l | grep -q 'libssl1.1'; then
|
|
|
|
wget -qO /tmp/libssl.deb "https://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.1_1.1.1w-0+deb11u2_amd64.deb"
|
|
|
|
$STD dpkg -i /tmp/libssl.deb
|
|
|
|
rm -f /tmp/libssl.deb
|
|
|
|
msg_ok "Installed libssl1.1"
|
|
|
|
else
|
|
|
|
msg_ok "libssl1.1 already installed"
|
|
|
|
fi
|
2023-06-15 11:31:31 -04:00
|
|
|
|
2025-02-24 14:50:09 +01:00
|
|
|
msg_info "Installing MongoDB $MONGODB_VERSION"
|
|
|
|
wget -qO- https://www.mongodb.org/static/pgp/server-${MONGODB_VERSION}.asc | gpg --dearmor >/usr/share/keyrings/mongodb-server-${MONGODB_VERSION}.gpg
|
|
|
|
echo "deb [signed-by=/usr/share/keyrings/mongodb-server-${MONGODB_VERSION}.gpg] http://repo.mongodb.org/apt/debian $(grep '^VERSION_CODENAME=' /etc/os-release | cut -d'=' -f2)/mongodb-org/${MONGODB_VERSION} main" >/etc/apt/sources.list.d/mongodb-org-${MONGODB_VERSION}.list
|
|
|
|
$STD apt-get update
|
|
|
|
$STD apt-get install -y mongodb-org
|
|
|
|
msg_ok "Installed MongoDB $MONGODB_VERSION"
|
2023-03-22 20:48:20 -04:00
|
|
|
|
2025-02-24 14:50:09 +01:00
|
|
|
msg_info "Installing Omada Controller"
|
2024-12-31 15:01:14 +01:00
|
|
|
latest_url=$(curl -s "https://support.omadanetworks.com/en/product/omada-software-controller/?resourceType=download" | grep -o 'https://static\.tp-link\.com/upload/software/[^"]*linux_x64[^"]*\.deb' | head -n 1)
|
2024-01-16 05:48:39 -05:00
|
|
|
latest_version=$(basename "$latest_url")
|
2023-08-09 05:18:30 -04:00
|
|
|
|
2023-08-09 07:45:13 -04:00
|
|
|
wget -qL ${latest_url}
|
2024-01-16 05:48:39 -05:00
|
|
|
$STD dpkg -i ${latest_version}
|
|
|
|
msg_ok "Installed Omada Controller"
|
2023-03-22 20:48:20 -04:00
|
|
|
|
|
|
|
motd_ssh
|
2023-05-15 07:39:30 -04:00
|
|
|
customize
|
2023-03-22 20:48:20 -04:00
|
|
|
|
|
|
|
msg_info "Cleaning up"
|
2025-02-24 14:50:09 +01:00
|
|
|
rm -rf ${latest_version} zulu-repo_1.0.0-3_all.deb
|
2024-06-02 08:00:22 -04:00
|
|
|
$STD apt-get -y autoremove
|
|
|
|
$STD apt-get -y autoclean
|
2023-03-22 20:48:20 -04:00
|
|
|
msg_ok "Cleaned"
|