Skip to content

Commit a5d6023

Browse files
authored
Fix Omada - Crawling latest version (#918)
* Fix Update Function Omada * Fix Omada Install Latest URL * Fix Dependencies
1 parent 773e3ba commit a5d6023

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

ct/omada.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function update_script() {
3232
msg_error "No ${APP} Installation Found!"
3333
exit
3434
fi
35-
latest_url=$(curl -fsSL "https://www.tp-link.com/en/support/download/omada-software-controller/" | grep -o 'https://.*x64.deb' | head -n1)
36-
latest_version=$(basename "${latest_url}")
35+
latest_url=$(curl -fsSL "https://www.tp-link.com/en/support/download/omada-software-controller/" | grep -oP 'href="([^"]+linux_x64[^"]+\.deb)"' | sed 's/href="//' | sort | tail -n 1)
36+
latest_version=$(basename "$latest_url")
3737
if [ -z "${latest_version}" ]; then
3838
msg_error "It seems that the server (tp-link.com) might be down. Please try again at a later time."
3939
exit
@@ -53,4 +53,4 @@ description
5353
msg_ok "Completed Successfully!\n"
5454
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
5555
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
56-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8043${CL}"
56+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8043${CL}"

install/omada-install.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ network_check
1414
update_os
1515

1616
msg_info "Installing Dependencies"
17-
$STD apt-get install -y curl
18-
$STD apt-get install -y sudo
19-
$STD apt-get install -y mc
20-
$STD apt-get install -y gnupg
21-
$STD apt-get install -y jsvc
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
gnupg \
22+
jsvc
2223
msg_ok "Installed Dependencies"
2324

2425
msg_info "Installing Azul Zulu"
@@ -37,7 +38,7 @@ wget -qL https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/3.6/multiv
3738
$STD dpkg -i mongodb-org-server_3.6.23_amd64.deb
3839
msg_ok "Installed MongoDB"
3940

40-
latest_url=$(curl -fsSL "https://www.tp-link.com/en/support/download/omada-software-controller/" | grep -o 'https://.*x64.deb' | head -n1)
41+
latest_url=$(curl -fsSL "https://www.tp-link.com/en/support/download/omada-software-controller/" | grep -oP 'href="([^"]+linux_x64[^"]+\.deb)"' | sed 's/href="//' | sort | tail -n 1)
4142
latest_version=$(basename "$latest_url")
4243

4344
msg_info "Installing Omada Controller"

0 commit comments

Comments
 (0)