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