mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-12 19:44:57 +02:00
Save Omada version (#14433)
This commit is contained in:
32
ct/omada.sh
32
ct/omada.sh
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user