Skip to content

Commit 1455d4d

Browse files
committed
Correct sed(1) RE to extract version from the FW filename.
So far, I've seen `ubi`, `nand_squashfs`, and `puresqubi`. While I'm at it, tighten up the REs. Fixes updating models such as the ZenWiFi XT8 (RT-AX95Q) that use `puresqubi` or `nand_squashfs` images.
1 parent 4cc6844 commit 1455d4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MerlinAU.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4996,7 +4996,7 @@ _GetLatestFWUpdateVersionFromGitHub_()
49964996
# Extract the version portion from the URL #
49974997
urlVersion="$(echo "$theURL" \
49984998
| grep -oE "${PRODUCT_ID}_[^ ]*\.(w|pkgtb)" \
4999-
| sed "s/${PRODUCT_ID}_//;s/.w$//;s/.pkgtb$//;s/.ubi$//;s/_/./g;s/-gnuton[0-9][0-9]*\$//" | head -n1)"
4999+
| sed "s/${PRODUCT_ID}_//;s/\\.w$//;s/\\.pkgtb$//;s/_\\(ubi\\|puresqubi\\|nand_squashfs\\)$//;s/_/./g;s/-gnuton[0-9][0-9]*$//" | head -n1)"
50005000

50015001
if [ "$urlVersion" = "$routerVersion" ]
50025002
then
@@ -5059,7 +5059,7 @@ GetLatestFirmwareMD5URL()
50595059
# Extract the version portion from the URL #
50605060
md5Version="$(echo "$theURL" \
50615061
| grep -oE "${PRODUCT_ID}_[^ ]*\.(md5)" \
5062-
| sed "s/${PRODUCT_ID}_//;s/.md5$//;s/.w$//;s/.pkgtb$//;s/.ubi$//;s/_/./g;s/-gnuton[0-9][0-9]*\$//" | head -n1)"
5062+
| sed "s/${PRODUCT_ID}_//;s/\\.md5$//;s/\\.w$//;s/\\.pkgtb$//;s/_\\(ubi\\|puresqubi\\|nand_squashfs\\)$//;s/_/./g;s/-gnuton[0-9][0-9]*$//" | head -n1)"
50635063

50645064
if [ "$md5Version" = "$routerVersion" ]
50655065
then

0 commit comments

Comments
 (0)