Skip to content

Commit 54118a3

Browse files
Merge pull request #508 from Martinski4GitHub/dev
Manual F/W Update Checks When Automatic Switch is Disabled
2 parents 4817e1a + ece91e7 commit 54118a3

File tree

3 files changed

+43
-16
lines changed

3 files changed

+43
-16
lines changed

MerlinAU.sh

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
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-10
88
###################################################################
99
set -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="25081021"
1314
readonly SCRIPT_NAME="MerlinAU"
1415
## Set to "master" for Production Releases ##
1516
SCRIPT_BRANCH="dev"
@@ -77,6 +78,12 @@ readonly ScriptFileName="${0##*/}"
7778
readonly ScriptFNameTag="${ScriptFileName%%.*}"
7879
readonly 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
555563
Help & 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
558566
Wiki 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
576586
Available 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
#------------------------------------------------------
@@ -10116,8 +10138,8 @@ _ConfirmCronJobForFWAutoUpdates_()
1011610138
fi
1011710139

1011810140
##------------------------------------------------------------##
10119-
# If 'runfwUpdateCheck' is true and built-in script is found
10120-
# run the built-in F/W Update check in the background.
10141+
# If 'runfwUpdateCheck' is true and the built-in script is
10142+
# present then execute the built-in F/W Update check now.
1012110143
##------------------------------------------------------------##
1012210144
if "$runfwUpdateCheck" && [ -x "$FW_UpdateCheckScript" ]
1012310145
then
@@ -11138,6 +11160,11 @@ _Gnuton_Check_Webs_Update_Script_()
1113811160
fi
1113911161
}
1114011162

11163+
if [ "$SCRIPT_BRANCH" = "master" ]
11164+
then SCRIPT_VERS_INFO="[$branchx_TAG]"
11165+
else SCRIPT_VERS_INFO="[$version_TAG, $branchx_TAG]"
11166+
fi
11167+
1114111168
## Set variable to 'false' to stop the check ##
1114211169
checkWebsUpdateScriptForGnuton="$isGNUtonFW"
1114311170
_Gnuton_Check_Webs_Update_Script_

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MerlinAU - AsusWRT-Merlin Firmware Auto Updater
2-
## v1.5.2
3-
## 2025-Aug-05
2+
## v1.5.3
3+
## 2025-Aug-10
44

55
## WebUI:
66
![image](https://github.com/user-attachments/assets/9c1dff99-9c13-491b-a7fa-aff924d5f02e)

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.5.2
1+
1.5.3

0 commit comments

Comments
 (0)