Save Omada version (#14433)

This commit is contained in:
Luca Comellini
2026-05-11 23:17:04 -07:00
committed by GitHub
parent 7b1c510b53
commit f4d50cac1a
2 changed files with 28 additions and 14 deletions

View File

@@ -38,20 +38,32 @@ function update_script() {
JAVA_VERSION="21" setup_java
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
OMADA_PKG=$(basename "${OMADA_URL}")
VERSION=$(sed -n 's/.*_v\([0-9.]*\)_.*_\([0-9]\{14\}\)\.deb$/\1-\2/p' <<<"${OMADA_PKG}")
CURRENT_VERSION=$(cat $HOME/.omada 2>/dev/null || echo "0")
if dpkg --compare-versions "${VERSION}" gt "${CURRENT_VERSION}"; then
msg_info "Updating Omada Controller"
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}"
echo "${VERSION}" >$HOME/.omada
msg_ok "Updated Omada Controller to ${VERSION}"
msg_ok "Updated successfully!"
else
msg_ok "No update available: ${APP} (${CURRENT_VERSION})"
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
}

View File

@@ -38,10 +38,12 @@ 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"
rm -rf "$OMADA_PKG"
OMADA_PKG=$(basename "${OMADA_URL}")
curl -fsSL "${OMADA_URL}" -o "${OMADA_PKG}"
$STD dpkg -i "${OMADA_PKG}"
rm -rf "${OMADA_PKG}"
VERSION=$(sed -n 's/.*_v\([0-9.]*\)_.*_\([0-9]\{14\}\)\.deb$/\1-\2/p' <<<"${OMADA_PKG}")
echo "${VERSION}" >$HOME/.omada
msg_ok "Installed Omada Controller"
motd_ssh