|
4 | 4 | # |
5 | 5 | # Original Creation Date: 2023-Oct-01 by @ExtremeFiretop. |
6 | 6 | # Official Co-Author: @Martinski W. - Date: 2023-Nov-01 |
7 | | -# Last Modified: 2025-Jul-02 |
| 7 | +# Last Modified: 2025-Jul-03 |
8 | 8 | ################################################################### |
9 | 9 | set -u |
10 | 10 |
|
@@ -775,7 +775,7 @@ _GetFirmwareVariantFromRouter_() |
775 | 775 |
|
776 | 776 | ##FOR TESTING/DEBUG ONLY## |
777 | 777 | if false # Change to true for forcing GNUton flag # |
778 | | - then hasGNUtonFW=true ; return 0 ; fi |
| 778 | + then echo "true" ; return 0 ; fi |
779 | 779 | ##FOR TESTING/DEBUG ONLY## |
780 | 780 |
|
781 | 781 | # Check if installed F/W NVRAM vars contain "gnuton" # |
@@ -11168,6 +11168,50 @@ _DoInitializationStartup_() |
11168 | 11168 | _SetDefaultBuildType_ |
11169 | 11169 | } |
11170 | 11170 |
|
| 11171 | +##-------------------------------------## |
| 11172 | +## Added by Martinski W. [2025-Jul-03] ## |
| 11173 | +##-------------------------------------## |
| 11174 | +####################################################################### |
| 11175 | +# TEMPORARY hack to check if the Gnuton F/W built-in 'webs_update.sh' |
| 11176 | +# script is the most recent version that includes required fixes. |
| 11177 | +# If not, we temporarily set up a local version so that MerlinAU |
| 11178 | +# can continue to work by detecting available F/W version updates. |
| 11179 | +# NOTE: |
| 11180 | +# The 'webs_update.sh' MUST have "SCRIPT_VERSTAG" variable defined. |
| 11181 | +####################################################################### |
| 11182 | +_Gnuton_Check_Webs_Update_Script_() |
| 11183 | +{ |
| 11184 | + if ! "$isGNUtonFW" || \ |
| 11185 | + ! "$checkWebsUpdateScriptForGnuton" || \ |
| 11186 | + grep -qE 'SCRIPT_VERSTAG="[0-9]+"' "$FW_UpdateCheckScript" |
| 11187 | + then |
| 11188 | + checkWebsUpdateScriptForGnuton=false |
| 11189 | + return 0 |
| 11190 | + fi |
| 11191 | + |
| 11192 | + local theWebsUpdateFile="webs_update.sh" |
| 11193 | + local fixedWebsUpdateFilePath="${SETTINGS_DIR}/$theWebsUpdateFile" |
| 11194 | + |
| 11195 | + ## Get the fixed version of the script targeted for Gnuton F/W ## |
| 11196 | + if _CurlFileDownload_ "gnuton_webs_update.sh" "$fixedWebsUpdateFilePath" |
| 11197 | + then |
| 11198 | + chmod 755 "$fixedWebsUpdateFilePath" |
| 11199 | + else |
| 11200 | + return 1 #NOT available so do nothing# |
| 11201 | + fi |
| 11202 | + |
| 11203 | + if ! diff "$FW_UpdateCheckScript" "$fixedWebsUpdateFilePath" >/dev/null 2>&1 |
| 11204 | + then |
| 11205 | + umount "$FW_UpdateCheckScript" 2>/dev/null |
| 11206 | + mount -o bind "$fixedWebsUpdateFilePath" "$FW_UpdateCheckScript" |
| 11207 | + Say "${YLWct}Set up a fixed version of the \"${theWebsUpdateFile}\" script file.${NOct}" |
| 11208 | + fi |
| 11209 | +} |
| 11210 | + |
| 11211 | +## Set variable to 'false' to stop the check ## |
| 11212 | +checkWebsUpdateScriptForGnuton="$isGNUtonFW" |
| 11213 | +_Gnuton_Check_Webs_Update_Script_ |
| 11214 | + |
11171 | 11215 | FW_InstalledVersion="$(_GetCurrentFWInstalledLongVersion_)" |
11172 | 11216 | FW_InstalledVerStr="${GRNct}${FW_InstalledVersion}${NOct}" |
11173 | 11217 | FW_NewUpdateVerInit=TBD |
|
0 commit comments