mirror of
https://github.com/tteck/Proxmox.git
synced 2024-11-25 17:55:01 +01:00
parent
0c543874c0
commit
693367e278
19
ct/omada.sh
19
ct/omada.sh
@ -56,26 +56,17 @@ 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
|
||||||
latest_url=$(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)
|
||||||
latest_version=$(basename "${latest_url}" | sed -e 's/.*ller_//;s/_Li.*//')
|
latest_version=$(basename "${latest_url}")
|
||||||
if [ -z "${latest_version}" ]; then
|
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."
|
msg_error "It seems that the server (tp-link.com) might be down. Please try again at a later time."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
installed_version=$(dpkg -l | grep omada | awk '{print $3}')
|
echo -e "Updating Omada Controller"
|
||||||
|
|
||||||
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}
|
wget -qL ${latest_url}
|
||||||
dpkg -i Omada_SDN_Controller_${latest_version}_Linux_x64.deb
|
dpkg -i ${latest_version}
|
||||||
rm -rf Omada_SDN_Controller_${latest_version}_Linux_x64.deb
|
rm -rf ${latest_version}
|
||||||
echo -e "Updated Omada Controller to ${latest_version}"
|
echo -e "Updated Omada Controller"
|
||||||
exit
|
exit
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
start
|
start
|
||||||
|
Loading…
Reference in New Issue
Block a user