omada: fix update script with mongodb 8 (#8724)

Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com>
This commit is contained in:
CanbiZ
2025-10-31 01:47:22 -07:00
committed by GitHub
parent 4def83ef00
commit b3a7e9340a

View File

@@ -29,19 +29,13 @@ function update_script() {
fi fi
msg_info "Updating MongoDB" msg_info "Updating MongoDB"
MONGODB_VERSION="7.0" if lscpu | grep -q 'avx'; then
if ! lscpu | grep -q 'avx'; then MONGO_VERSION="8.0" setup_mongodb
MONGODB_VERSION="4.4" else
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/" msg_warn "No AVX detected: Using older MongoDB 4.4"
exit MONGO_VERSION="4.4" setup_mongodb
fi fi
curl -fsSL "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 update
$STD apt install -y --only-upgrade mongodb-org
msg_ok "Updated MongoDB to $MONGODB_VERSION"
msg_info "Checking if right Azul Zulu Java is installed" msg_info "Checking if right Azul Zulu Java is installed"
java_version=$(java -version 2>&1 | awk -F[\"_] '/version/ {print $2}') java_version=$(java -version 2>&1 | awk -F[\"_] '/version/ {print $2}')
if [[ "$java_version" =~ ^1\.8\.* ]]; then if [[ "$java_version" =~ ^1\.8\.* ]]; then