From fbebe473d96fe22aecb478f1f679bfa3b010e9bb Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Mon, 8 Apr 2024 16:54:35 -0400 Subject: [PATCH] fix: updater: Fixed merlin_webs_update.sh script (#571) * Update merlin_webs_update.sh * Update merlin_webs_update.sh * Update merlin_webs_update.sh --- release/src/router/rom/webs_scripts/merlin_webs_update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/src/router/rom/webs_scripts/merlin_webs_update.sh b/release/src/router/rom/webs_scripts/merlin_webs_update.sh index 3677d31291d..4b32dcce671 100755 --- a/release/src/router/rom/webs_scripts/merlin_webs_update.sh +++ b/release/src/router/rom/webs_scripts/merlin_webs_update.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -x; +set -u; wget_options="-q -t 2 -T 30" fwsite="https://raw.githubusercontent.com/gnuton/asuswrt-merlin.ng/master/updates/" @@ -37,13 +37,13 @@ if [ "$?" != "0" ]; then nvram set webs_state_error=1 else - fullver=$(grep $model /tmp/wlan_update.txt | sed s/.*#FW//;) + fullver="$(grep "$model" /tmp/wlan_update.txt | tail -n1 | sed 's/.*#FW//')" fullver=$(echo $fullver | sed s/#.*//;) firmbase=$(echo $fullver | cut -d. -f1) firmver=$(echo $fullver | cut -d. -f2) buildno=$(echo $fullver | cut -d. -f3) - extendno=$(grep $model /tmp/wlan_update.txt | sed s/.*#EXT//;) + extendno="$(grep "$model" /tmp/wlan_update.txt | tail -n1 | sed 's/.*#EXT//')" extendno=$(echo $extendno | sed s/#.*//;) lextendno=$(echo $extendno | sed s/-g.*//;)