From 693367e2782a6f631a311c8e7641ce7ea6d73284 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 16 Jan 2024 05:53:10 -0500 Subject: [PATCH] Update omada.sh fixes https://github.com/tteck/Proxmox/issues/2349 --- ct/omada.sh | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/ct/omada.sh b/ct/omada.sh index 282d6508..82f28261 100644 --- a/ct/omada.sh +++ b/ct/omada.sh @@ -56,26 +56,17 @@ function update_script() { header_info if [[ ! -d /opt/tplink ]]; then msg_error "No ${APP} Installation Found!"; exit; fi latest_url=$(curl -fsSL "https://www.tp-link.com/us/support/download/omada-software-controller/" | grep -o 'https://.*x64.deb' | head -n1) -latest_version=$(basename "${latest_url}" | sed -e 's/.*ller_//;s/_Li.*//') +latest_version=$(basename "${latest_url}") if [ -z "${latest_version}" ]; then msg_error "It seems that the server (tp-link.com) might be down. Please try again at a later time." exit fi -installed_version=$(dpkg -l | grep omada | awk '{print $3}') - -if [ "v${installed_version}" = "${latest_version}" ]; then - msg_info "Installed version (v${installed_version}) is the same as the latest version (${latest_version})" - sleep 2 - msg_ok "Omada Controller is already up to date" - exit -else - echo -e "Updating Omada Controller to ${latest_version}" - wget -qL ${latest_url} - dpkg -i Omada_SDN_Controller_${latest_version}_Linux_x64.deb - rm -rf Omada_SDN_Controller_${latest_version}_Linux_x64.deb - echo -e "Updated Omada Controller to ${latest_version}" +echo -e "Updating Omada Controller" +wget -qL ${latest_url} +dpkg -i ${latest_version} +rm -rf ${latest_version} +echo -e "Updated Omada Controller" exit -fi } start