1
0
mirror of https://github.com/tteck/Proxmox.git synced 2024-11-28 09:33:13 +02:00

Update omada.sh

tweak
This commit is contained in:
tteckster 2023-08-09 07:48:14 -04:00 committed by GitHub
parent 60ebfe406e
commit b1f28071ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,20 +53,20 @@ function default_settings() {
function update_script() { function update_script() {
header_info header_info
if [[ ! -d /opt/tplink ]]; then msg_error "No ${APP} Installation Found!"; exit; fi if [[ ! -d /opt/tplink ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
latesturl=$(curl -fsSL "https://www.tp-link.com/us/support/download/omada-software-controller/" | grep -o 'https://.*x64.deb' | head -n1) latest_url=$(curl -fsSL "https://www.tp-link.com/us/support/download/omada-software-controller/" | grep -o 'https://.*x64.deb' | head -n1)
latestversion=$(basename "$latesturl" | sed -e 's/.*ller_v//;s/_Li.*//') latest_version=$(basename "$latest_url" | sed -e 's/.*ller_//;s/_Li.*//')
installed_version=$(dpkg -l | grep omada | awk '{print $3}') installed_version=$(dpkg -l | grep omada | awk '{print $3}')
if [ "$installed_version" = "$latestversion" ]; then if [ "v${installed_version}" = "${latest_version}" ]; then
echo "Installed version ($installed_version) is the same as the latest version ($latestversion)." echo "Installed version (v${installed_version}) is the same as the latest version (${latest_version})."
echo "Omada is already up to date" echo "Omada Controller is already up to date"
exit exit
else else
echo -e "Updating Omada Controller to v${latestversion}" echo -e "Updating Omada Controller to ${latest_version}"
wget -qL ${latesturl} wget -qL ${latest_url}
dpkg -i Omada_SDN_Controller_v${latestversion}_Linux_x64.deb dpkg -i Omada_SDN_Controller_${latest_version}_Linux_x64.deb
rm -rf Omada_SDN_Controller_v${latestversion}_Linux_x64.deb rm -rf Omada_SDN_Controller_${latest_version}_Linux_x64.deb
echo -e "Updated Omada Controller to v${latestversion}" echo -e "Updated Omada Controller to ${latest_version}"
exit exit
fi fi
} }