Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/workflows/Create-NewReleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4.2.2
uses: actions/checkout@v5.0.0
with:
fetch-depth: 0
ref: 'main' # Ensure we're tagging the main branch after the merge
Expand Down
58 changes: 43 additions & 15 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-13
###################################################################
set -u

## Set version for each Production Release ##
readonly SCRIPT_VERSION=1.5.2
readonly SCRIPT_VERSION=1.5.3
readonly SCRIPT_VERSTAG="25081319"
readonly SCRIPT_NAME="MerlinAU"
## Set to "master" for Production Releases ##
SCRIPT_BRANCH="master"
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 @@ -9546,7 +9568,6 @@ _CheckForMinimumRequirements_()

"$requirementsCheckOK" && return 0

rm -f "$CONFIG_FILE"
return 1
}

Expand Down Expand Up @@ -9608,7 +9629,7 @@ _DoInstallation_()
}

##----------------------------------------##
## Modified by Martinski W. [2025-Apr-11] ##
## Modified by Martinski W. [2025-Aug-13] ##
##----------------------------------------##
_DoUnInstallation_()
{
Expand Down Expand Up @@ -9645,6 +9666,8 @@ _DoUnInstallation_()
_AutoServiceEvent_ delete 2>/dev/null
fi

"$isGNUtonFW" && umount "$FW_UpdateCheckScript" 2>/dev/null

if rm -fr "${SETTINGS_DIR:?}" && \
rm -fr "${SCRIPT_WEB_DIR:?}" && \
rm -fr "${FW_BIN_BASE_DIR:?}/$ScriptDirNameD" && \
Expand Down Expand Up @@ -10116,8 +10139,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 +11161,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-13

## 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