mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-05-13 12:15:03 +00:00
Save Omada version (#14433)
This commit is contained in:
+22
-10
@@ -38,20 +38,32 @@ function update_script() {
|
|||||||
|
|
||||||
JAVA_VERSION="21" setup_java
|
JAVA_VERSION="21" setup_java
|
||||||
|
|
||||||
msg_info "Updating Omada Controller"
|
|
||||||
OMADA_URL=$(curl -fsSL "https://support.omadanetworks.com/en/download/software/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' |
|
grep -o 'https://static\.tp-link\.com/upload/software/[^"]*linux_x64[^"]*\.deb' |
|
||||||
head -n1)
|
head -n1)
|
||||||
OMADA_PKG=$(basename "$OMADA_URL")
|
OMADA_PKG=$(basename "${OMADA_URL}")
|
||||||
if [ -z "$OMADA_PKG" ]; then
|
VERSION=$(sed -n 's/.*_v\([0-9.]*\)_.*_\([0-9]\{14\}\)\.deb$/\1-\2/p' <<<"${OMADA_PKG}")
|
||||||
msg_error "Could not retrieve Omada package – server may be down."
|
|
||||||
exit
|
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
|
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
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,10 +38,12 @@ msg_info "Installing Omada Controller"
|
|||||||
OMADA_URL=$(curl -fsSL "https://support.omadanetworks.com/en/download/software/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' |
|
grep -o 'https://static\.tp-link\.com/upload/software/[^"]*linux_x64[^"]*\.deb' |
|
||||||
head -n1)
|
head -n1)
|
||||||
OMADA_PKG=$(basename "$OMADA_URL")
|
OMADA_PKG=$(basename "${OMADA_URL}")
|
||||||
curl -fsSL "$OMADA_URL" -o "$OMADA_PKG"
|
curl -fsSL "${OMADA_URL}" -o "${OMADA_PKG}"
|
||||||
$STD dpkg -i "$OMADA_PKG"
|
$STD dpkg -i "${OMADA_PKG}"
|
||||||
rm -rf "$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"
|
msg_ok "Installed Omada Controller"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
|
|||||||
Reference in New Issue
Block a user