44#
55# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
66# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
7- # Last Modified: 2025-Aug-05
7+ # Last Modified: 2025-Aug-13
88# ##################################################################
99set -u
1010
1111# # Set version for each Production Release ##
12- readonly SCRIPT_VERSION=1.5.2
12+ readonly SCRIPT_VERSION=1.5.3
13+ readonly SCRIPT_VERSTAG=" 25081319"
1314readonly SCRIPT_NAME=" MerlinAU"
1415# # Set to "master" for Production Releases ##
1516SCRIPT_BRANCH=" master"
@@ -77,6 +78,12 @@ readonly ScriptFileName="${0##*/}"
7778readonly ScriptFNameTag=" ${ScriptFileName%% .* } "
7879readonly ScriptDirNameD=" ${ScriptFNameTag} .d"
7980
81+ if [ " $SCRIPT_BRANCH " = " dev" ]
82+ then readonly branchx_TAG=" Branch: development"
83+ else readonly branchx_TAG=" Branch: $SCRIPT_BRANCH "
84+ fi
85+ readonly version_TAG=" ${SCRIPT_VERSION} _${SCRIPT_VERSTAG} "
86+
8087# #----------------------------------------##
8188# # Modified by Martinski W. [2025-Jan-15] ##
8289# #----------------------------------------##
@@ -536,8 +543,9 @@ _ShowAbout_()
536543
537544 clear
538545 _ShowLogo_
546+
547+ printf " About ${MGNTct}${SCRIPT_VERS_INFO}${NOct} \n"
539548 cat << EOF
540- About
541549 $SCRIPT_NAME is a tool for automating firmware updates on AsusWRT-Merlin,
542550 ensuring your router stays up-to-date with the latest features and
543551 security patches. It greatly simplifies the firmware update process
@@ -553,7 +561,7 @@ License
553561 version 3 (GPL-3.0) https://opensource.org/licenses/GPL-3.0
554562
555563Help & Support
556- https://www.snbforums.com/threads/merlinau-the-ultimate-firmware-auto-updater-addon.88577/
564+ https://www.snbforums.com/forums/asuswrt-merlin-addons.60/?prefix_id=41
557565
558566Wiki page:
559567 https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/wiki
@@ -572,6 +580,8 @@ _ShowHelp_()
572580{
573581 clear
574582 _ShowLogo_
583+
584+ printf " HELP ${MGNTct}${SCRIPT_VERS_INFO}${NOct} \n"
575585 cat << EOF
576586Available commands:
577587 ${SCRIPT_NAME} .sh about describe add-on functionality
@@ -6100,10 +6110,12 @@ _Calculate_NextRunTime_()
61006110 then
61016111 # If conditions are met (cron job enabled and update available), calculate the next runtime
61026112 fwNewUpdateNotificationDate=" $( Get_Custom_Setting FW_New_Update_Notification_Date) "
6103- if [ " $fwNewUpdateNotificationDate " = " TBD" ] || [ -z " $fwNewUpdateNotificationDate " ]
6113+ if [ -z " $fwNewUpdateNotificationDate " ] || \
6114+ [ " $fwNewUpdateNotificationDate " = " TBD" ]
61046115 then
61056116 fwNewUpdateNotificationDate=" $( date +%Y-%m-%d_%H:%M:%S) "
61066117 fi
6118+
61076119 upfwDateTimeSecs=" $( _Calculate_DST_ " $( echo " $fwNewUpdateNotificationDate " | sed ' s/_/ /g' ) " ) "
61086120 ExpectedFWUpdateRuntime=" $( _EstimateNextCronTimeAfterDate_ " $upfwDateTimeSecs " " $FW_UpdateCronJobSchedule " ) "
61096121 if [ " $ExpectedFWUpdateRuntime " = " $CRON_UNKNOWN_DATE " ]
@@ -8673,9 +8685,9 @@ _RunOfflineUpdateNow_()
86738685 fi
86748686}
86758687
8676- # #------------------------------------------ ##
8677- # # Modified by ExtremeFiretop [2025-May-17 ] ##
8678- # #------------------------------------------ ##
8688+ # #----------------------------------------##
8689+ # # Modified by Martinski W. [2025-Aug-10 ] ##
8690+ # #----------------------------------------##
86798691_RunFirmwareUpdateNow_ ()
86808692{
86818693 # Double-check the directory exists before using it #
@@ -8717,7 +8729,7 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or
87178729
87188730 echo
87198731 Say " ${GRNct} MerlinAU${NOct} v$SCRIPT_VERSION "
8720- Say " Running the update task now... Checking for F/W updates..."
8732+ Say " Running the update task now. Checking for F/W updates..."
87218733 FlashStarted=true
87228734
87238735 # ---------------------------------------------------------------#
@@ -8781,8 +8793,18 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or
87818793
87828794 if [ " $FW_UpdateCheckState " -eq 0 ]
87838795 then
8784- Say " Firmware update check is currently disabled."
8785- " $inMenuMode " && _WaitForEnterKey_ || return 1
8796+ Say " Automatic F/W update checks are currently ${REDct} DISABLED${NOct} ."
8797+ ! " $inMenuMode " && return 1
8798+
8799+ if [ -x " $FW_UpdateCheckScript " ]
8800+ then
8801+ # Prompt the user to confirm and proceed IFF in "Menu Mode" #
8802+ printf " \n${BOLDct} Would you like to proceed with a manual F/W update check now${NOct} "
8803+ ! _WaitForYESorNO_ && return 1
8804+
8805+ sh " $FW_UpdateCheckScript " 2>&1
8806+ sleep 2
8807+ fi
87868808 fi
87878809
87888810 # ------------------------------------------------------
@@ -9546,7 +9568,6 @@ _CheckForMinimumRequirements_()
95469568
95479569 " $requirementsCheckOK " && return 0
95489570
9549- rm -f " $CONFIG_FILE "
95509571 return 1
95519572}
95529573
@@ -9608,7 +9629,7 @@ _DoInstallation_()
96089629}
96099630
96109631# #----------------------------------------##
9611- # # Modified by Martinski W. [2025-Apr-11 ] ##
9632+ # # Modified by Martinski W. [2025-Aug-13 ] ##
96129633# #----------------------------------------##
96139634_DoUnInstallation_ ()
96149635{
@@ -9645,6 +9666,8 @@ _DoUnInstallation_()
96459666 _AutoServiceEvent_ delete 2> /dev/null
96469667 fi
96479668
9669+ " $isGNUtonFW " && umount " $FW_UpdateCheckScript " 2> /dev/null
9670+
96489671 if rm -fr " ${SETTINGS_DIR:? } " && \
96499672 rm -fr " ${SCRIPT_WEB_DIR:? } " && \
96509673 rm -fr " ${FW_BIN_BASE_DIR:? } /$ScriptDirNameD " && \
@@ -10116,8 +10139,8 @@ _ConfirmCronJobForFWAutoUpdates_()
1011610139 fi
1011710140
1011810141 # #------------------------------------------------------------##
10119- # If 'runfwUpdateCheck' is true and built-in script is found
10120- # run the built-in F/W Update check in the background .
10142+ # If 'runfwUpdateCheck' is true and the built-in script is
10143+ # present then execute the built-in F/W Update check now .
1012110144 # #------------------------------------------------------------##
1012210145 if " $runfwUpdateCheck " && [ -x " $FW_UpdateCheckScript " ]
1012310146 then
@@ -11138,6 +11161,11 @@ _Gnuton_Check_Webs_Update_Script_()
1113811161 fi
1113911162}
1114011163
11164+ if [ " $SCRIPT_BRANCH " = " master" ]
11165+ then SCRIPT_VERS_INFO=" [$branchx_TAG ]"
11166+ else SCRIPT_VERS_INFO=" [$version_TAG , $branchx_TAG ]"
11167+ fi
11168+
1114111169# # Set variable to 'false' to stop the check ##
1114211170checkWebsUpdateScriptForGnuton=" $isGNUtonFW "
1114311171_Gnuton_Check_Webs_Update_Script_
0 commit comments