Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 40 additions & 13 deletions MerlinAU.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
#
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
# Last Modified: 2025-Aug-05
# Last Modified: 2025-Aug-10
###################################################################
set -u

## Set version for each Production Release ##
readonly SCRIPT_VERSION=1.5.2
readonly SCRIPT_VERSION=1.5.3
readonly SCRIPT_VERSTAG="25081021"
readonly SCRIPT_NAME="MerlinAU"
## Set to "master" for Production Releases ##
SCRIPT_BRANCH="dev"
Expand Down Expand Up @@ -77,6 +78,12 @@ readonly ScriptFileName="${0##*/}"
readonly ScriptFNameTag="${ScriptFileName%%.*}"
readonly ScriptDirNameD="${ScriptFNameTag}.d"

if [ "$SCRIPT_BRANCH" = "dev" ]
then readonly branchx_TAG="Branch: development"
else readonly branchx_TAG="Branch: $SCRIPT_BRANCH"
fi
readonly version_TAG="${SCRIPT_VERSION}_${SCRIPT_VERSTAG}"

##----------------------------------------##
## Modified by Martinski W. [2025-Jan-15] ##
##----------------------------------------##
Expand Down Expand Up @@ -536,8 +543,9 @@ _ShowAbout_()

clear
_ShowLogo_

printf "About ${MGNTct}${SCRIPT_VERS_INFO}${NOct}\n"
cat <<EOF
About
$SCRIPT_NAME is a tool for automating firmware updates on AsusWRT-Merlin,
ensuring your router stays up-to-date with the latest features and
security patches. It greatly simplifies the firmware update process
Expand All @@ -553,7 +561,7 @@ License
version 3 (GPL-3.0) https://opensource.org/licenses/GPL-3.0

Help & Support
https://www.snbforums.com/threads/merlinau-the-ultimate-firmware-auto-updater-addon.88577/
https://www.snbforums.com/forums/asuswrt-merlin-addons.60/?prefix_id=41

Wiki page:
https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/wiki
Expand All @@ -572,6 +580,8 @@ _ShowHelp_()
{
clear
_ShowLogo_

printf "HELP ${MGNTct}${SCRIPT_VERS_INFO}${NOct}\n"
cat <<EOF
Available commands:
${SCRIPT_NAME}.sh about describe add-on functionality
Expand Down Expand Up @@ -6100,10 +6110,12 @@ _Calculate_NextRunTime_()
then
# If conditions are met (cron job enabled and update available), calculate the next runtime
fwNewUpdateNotificationDate="$(Get_Custom_Setting FW_New_Update_Notification_Date)"
if [ "$fwNewUpdateNotificationDate" = "TBD" ] || [ -z "$fwNewUpdateNotificationDate" ]
if [ -z "$fwNewUpdateNotificationDate" ] || \
[ "$fwNewUpdateNotificationDate" = "TBD" ]
then
fwNewUpdateNotificationDate="$(date +%Y-%m-%d_%H:%M:%S)"
fi

upfwDateTimeSecs="$(_Calculate_DST_ "$(echo "$fwNewUpdateNotificationDate" | sed 's/_/ /g')")"
ExpectedFWUpdateRuntime="$(_EstimateNextCronTimeAfterDate_ "$upfwDateTimeSecs" "$FW_UpdateCronJobSchedule")"
if [ "$ExpectedFWUpdateRuntime" = "$CRON_UNKNOWN_DATE" ]
Expand Down Expand Up @@ -8673,9 +8685,9 @@ _RunOfflineUpdateNow_()
fi
}

##------------------------------------------##
## Modified by ExtremeFiretop [2025-May-17] ##
##------------------------------------------##
##----------------------------------------##
## Modified by Martinski W. [2025-Aug-10] ##
##----------------------------------------##
_RunFirmwareUpdateNow_()
{
# Double-check the directory exists before using it #
Expand Down Expand Up @@ -8717,7 +8729,7 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or

echo
Say "${GRNct}MerlinAU${NOct} v$SCRIPT_VERSION"
Say "Running the update task now... Checking for F/W updates..."
Say "Running the update task now. Checking for F/W updates..."
FlashStarted=true

#---------------------------------------------------------------#
Expand Down Expand Up @@ -8781,8 +8793,18 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or

if [ "$FW_UpdateCheckState" -eq 0 ]
then
Say "Firmware update check is currently disabled."
"$inMenuMode" && _WaitForEnterKey_ || return 1
Say "Automatic F/W update checks are currently ${REDct}DISABLED${NOct}."
! "$inMenuMode" && return 1

if [ -x "$FW_UpdateCheckScript" ]
then
# Prompt the user to confirm and proceed IFF in "Menu Mode" #
printf "\n${BOLDct}Would you like to proceed with a manual F/W update check now${NOct}"
! _WaitForYESorNO_ && return 1

sh "$FW_UpdateCheckScript" 2>&1
sleep 2
fi
fi

#------------------------------------------------------
Expand Down Expand Up @@ -10116,8 +10138,8 @@ _ConfirmCronJobForFWAutoUpdates_()
fi

##------------------------------------------------------------##
# If 'runfwUpdateCheck' is true and built-in script is found
# run the built-in F/W Update check in the background.
# If 'runfwUpdateCheck' is true and the built-in script is
# present then execute the built-in F/W Update check now.
##------------------------------------------------------------##
if "$runfwUpdateCheck" && [ -x "$FW_UpdateCheckScript" ]
then
Expand Down Expand Up @@ -11138,6 +11160,11 @@ _Gnuton_Check_Webs_Update_Script_()
fi
}

if [ "$SCRIPT_BRANCH" = "master" ]
then SCRIPT_VERS_INFO="[$branchx_TAG]"
else SCRIPT_VERS_INFO="[$version_TAG, $branchx_TAG]"
fi

## Set variable to 'false' to stop the check ##
checkWebsUpdateScriptForGnuton="$isGNUtonFW"
_Gnuton_Check_Webs_Update_Script_
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MerlinAU - AsusWRT-Merlin Firmware Auto Updater
## v1.5.2
## 2025-Aug-05
## v1.5.3
## 2025-Aug-10

## WebUI:
![image](https://github.com/user-attachments/assets/9c1dff99-9c13-491b-a7fa-aff924d5f02e)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.2
1.5.3