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
57 changes: 29 additions & 28 deletions MerlinAU.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
# Last Modified: 2025-Apr-14
# Last Modified: 2025-May-05
###################################################################
set -u

## Set version for each Production Release ##
readonly SCRIPT_VERSION=1.4.3
readonly SCRIPT_VERSION=1.4.4
readonly SCRIPT_NAME="MerlinAU"
## Set to "master" for Production Releases ##
SCRIPT_BRANCH="master"
SCRIPT_BRANCH="dev"

##----------------------------------------##
## Modified by Martinski W. [2024-Jul-03] ##
Expand Down Expand Up @@ -309,14 +309,15 @@ _UserLogMsg_()
}

##----------------------------------------##
## Modified by Martinski W. [2025-Feb-15] ##
## Modified by Martinski W. [2025-May-05] ##
##----------------------------------------##
Say()
{
local logMsg
"$isInteractive" && printf "${1}\n"
# Remove all "color escape sequences" from the system log file entries #
logMsg="$(echo "$1" | sed 's/\\\e\[[0-1]m//g ; s/\\\e\[[0-1];[3-4][0-9]m//g')"
logMsg="$(echo "$1" | \
sed 's/\\e\[[0-1]m//g; s/\\e\[[3-4][0-9]m//g; s/\\e\[[0-1];[3-4][0-9]m//g; s/\\e\[30;10[1-9]m//g; s/\\n/ /g')"
_UserLogMsg_ "$logMsg"
printf "$logMsg" | logger -t "[${SCRIPT_NAME}] $$"
}
Expand Down Expand Up @@ -2829,9 +2830,9 @@ _DownloadScriptFiles_()
return "$retCode"
}

##------------------------------------------##
## Modified by ExtremeFiretop [2025-Apr-14] ##
##------------------------------------------##
##----------------------------------------##
## Modified by Martinski W. [2025-May-05] ##
##----------------------------------------##
_SCRIPT_UPDATE_()
{
local extraParam=""
Expand Down Expand Up @@ -2868,7 +2869,6 @@ _SCRIPT_UPDATE_()
fi
return 1
fi
return 0
fi

! _CheckForNewScriptUpdates_ && return 1
Expand Down Expand Up @@ -4758,9 +4758,9 @@ _GetLatestFWUpdateVersionFromWebsite_()
return 0
}

##----------------------------------------##
## Modified by Martinski W. [2024-Mar-27] ##
##----------------------------------------##
##------------------------------------------##
## Modified by ExtremeFiretop [2024-May-05] ##
##------------------------------------------##
_GetLatestFWUpdateVersionFromGitHub_()
{
local routerVersion
Expand All @@ -4777,7 +4777,7 @@ _GetLatestFWUpdateVersionFromGitHub_()

if ! "$offlineUpdateTrigger"
then
routerVersion="$(_GetLatestFWUpdateVersionFromRouter_ 1)"
routerVersion="$(_GetLatestFWUpdateVersionFromRouter_)"
else
routerVersion="$(Get_Custom_Setting "FW_New_Update_Notification_Vers")"
fi
Expand Down Expand Up @@ -4809,7 +4809,7 @@ _GetLatestFWUpdateVersionFromGitHub_()
# Extract the version portion from the URL #
urlVersion="$(echo "$theURL" \
| grep -oE "${PRODUCT_ID}_[^ ]*\.(w|pkgtb)" \
| sed "s/${PRODUCT_ID}_//;s/.w$//;s/.pkgtb$//;s/.ubi$//;s/_/./g" | head -n1)"
| sed "s/${PRODUCT_ID}_//;s/.w$//;s/.pkgtb$//;s/.ubi$//;s/_/./g;s/-gnuton[0-9][0-9]*\$//" | head -n1)"

if [ "$urlVersion" = "$routerVersion" ]
then
Expand All @@ -4821,9 +4821,9 @@ _GetLatestFWUpdateVersionFromGitHub_()
fi
}

##----------------------------------------##
## Modified by Martinski W. [2024-Mar-27] ##
##----------------------------------------##
##------------------------------------------##
## Modified by ExtremeFiretop [2024-May-05] ##
##------------------------------------------##
GetLatestFirmwareMD5URL()
{
local routerVersion
Expand All @@ -4840,7 +4840,7 @@ GetLatestFirmwareMD5URL()

if ! "$offlineUpdateTrigger"
then
routerVersion="$(_GetLatestFWUpdateVersionFromRouter_ 1)"
routerVersion="$(_GetLatestFWUpdateVersionFromRouter_)"
else
routerVersion="$(Get_Custom_Setting "FW_New_Update_Notification_Vers")"
fi
Expand Down Expand Up @@ -4872,7 +4872,7 @@ GetLatestFirmwareMD5URL()
# Extract the version portion from the URL #
md5Version="$(echo "$theURL" \
| grep -oE "${PRODUCT_ID}_[^ ]*\.(md5)" \
| sed "s/${PRODUCT_ID}_//;s/.md5$//;s/.w$//;s/.pkgtb$//;s/.ubi$//;s/_/./g" | head -n1)"
| sed "s/${PRODUCT_ID}_//;s/.md5$//;s/.w$//;s/.pkgtb$//;s/.ubi$//;s/_/./g;s/-gnuton[0-9][0-9]*\$//" | head -n1)"

if [ "$md5Version" = "$routerVersion" ]
then
Expand Down Expand Up @@ -7310,7 +7310,7 @@ _ChangelogVerificationCheck_()
local current_version formatted_current_version
local release_version formatted_release_version
local checkChangeLogSetting="$(Get_Custom_Setting "CheckChangeLog")"
local changeLogFName changeLogFPath
local changeLogFName changeLogFPath changeLogTag

if [ "$checkChangeLogSetting" = "ENABLED" ]
then
Expand Down Expand Up @@ -7507,15 +7507,15 @@ _ManageChangelogMerlin_()
}

##------------------------------------------##
## Modified by ExtremeFiretop [2025-Apr-11] ##
## Modified by ExtremeFiretop [2025-May-05] ##
##------------------------------------------##
_ManageChangelogGnuton_()
{
if [ $# -eq 0 ] || [ -z "$1" ]
then echo "**ERROR** **NO_PARAMS**" ; return 1 ; fi

local mode="$1" # Mode should be 'download' or 'view' #
local wgetLogFile changeLogFile changeLogTag
local wgetLogFile FW_Changelog_GITHUB

# Create directory to download changelog if missing
if ! _CreateDirectory_ "$FW_BIN_DIR" ; then return 1 ; fi
Expand Down Expand Up @@ -7569,7 +7569,7 @@ _ManageChangelogGnuton_()
less "$FW_Changelog_GITHUB"
fi
fi
cp -fp "$changeLogFile" "$CHANGELOG_PATH"
cp -fp "$FW_Changelog_GITHUB" "$CHANGELOG_PATH"
rm -f "$FW_Changelog_GITHUB" "$wgetLogFile"
ln -sf "$CHANGELOG_PATH" "${SCRIPT_WEB_DIR}/changelog.htm" 2>/dev/null
return 0
Expand Down Expand Up @@ -8546,9 +8546,9 @@ _RunOfflineUpdateNow_()
fi
}

##----------------------------------------##
## Modified by Martinski W. [2025-Mar-07] ##
##----------------------------------------##
##------------------------------------------##
## Modified by ExtremeFiretop [2025-May-05] ##
##------------------------------------------##
_RunFirmwareUpdateNow_()
{
# Double-check the directory exists before using it #
Expand Down Expand Up @@ -8709,7 +8709,8 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or
if [ "$NewUpdate_VersionVerify" != "$release_version" ]
then
Say "WARNING: The release version found by MerlinAU [$release_version] does not match the F/W update version from the router [$NewUpdate_VersionVerify]."
"$inMenuMode" && _WaitForEnterKey_ "$mainMenuReturnPromptStr" || return 1
"$inMenuMode" && _WaitForEnterKey_ "$mainMenuReturnPromptStr"
return 1
fi
fi

Expand Down Expand Up @@ -9048,7 +9049,7 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or

_SendEMailNotification_ POST_REBOOT_FW_UPDATE_SETUP
echo
Say "Flashing ${GRNct}${firmware_file}${NOct}... ${REDct}Please wait for reboot in about 4 minutes or less.${NOct}"
Say "Flashing ${GRNct}${firmware_file}${NOct}...\n${REDct}Please wait for reboot in about 4 minutes or less.${NOct}"
echo

# *WARNING*: NO MORE logging at this point & beyond #
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.4.3
## 2025-Apr-26
## v1.4.4
## 2025-May-08

## WebUI:
![image](https://github.com/user-attachments/assets/a2197262-ca35-451a-8645-311896e1495e)
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.3
1.4.4