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
70 changes: 38 additions & 32 deletions MerlinAU.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,13 +4,13 @@
#
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
# Last Modified: 2026-May-16
# Last Modified: 2026-May-21
###################################################################
set -u

## Set version for each Production Release ##
readonly SCRIPT_VERSION=1.6.3
readonly SCRIPT_VERSTAG="26052100"
readonly SCRIPT_VERSTAG="26052123"
readonly SCRIPT_NAME="MerlinAU"
## Set to "master" for Production Releases ##
SCRIPT_BRANCH="dev"
Expand DownExpand Up@@ -173,14 +173,28 @@ fi
inMenuMode=true
webguiMode=false
isVerbose=false
isInteractive=false
FlashStarted=false
MerlinChangeLogURL=""
GnutonChangeLogURL=""
keepConfigFile=false
bypassPostponedDays=false
runLoginCredentialsTest=false

if [ -t 0 ] && ! tty | grep -qwi "NOT"
then
isVerbose=true
readonly isInteractive=true
readonly gSavedSTTY="$(stty -g)"
else
readonly isInteractive=false
fi

if [ "$isInteractive" = "false" ] && { [ $# -eq 0 ] || [ -z "$1" ] ; }
then
logger -st "${SCRIPT_NAME}_[$$]" -p 3 "**ERROR**: CLI Menu is NOT available in a non-interactive shell"
exit 1
Comment thread
ExtremeFiretop marked this conversation as resolved.
fi

# Main LAN Network Info #
readonly myLAN_HostName="$(nvram get lan_hostname)"
readonly mainLAN_IFname="$(nvram get lan_ifname)"
Expand DownExpand Up@@ -277,12 +291,6 @@ routerLoginFailureMsg="Please try the following:
to restrict access to the router webGUI from the router's IP address [${GRNct}${mainLAN_IPaddr}${NOct}].
3. Confirm your password via the \"Set Router Login Password\" option from the Main Menu."

if [ -t 0 ] && ! tty | grep -qwi "NOT"
then
isInteractive=true ; isVerbose=true
readonly gSavedSTTY="$(stty -g)"
fi

##----------------------------------------##
## Modified by Martinski W. [2023-Dec-23] ##
##----------------------------------------##
Expand DownExpand Up@@ -3011,7 +3019,7 @@ _CheckNewScriptMinFWBeforeUpdate_()
}

##----------------------------------------##
## Modified by Martinski W. [2026-Feb-22] ##
## Modified by Martinski W. [2026-May-21] ##
##----------------------------------------##
_SCRIPT_UPDATE_()
{
Expand DownExpand Up@@ -3062,18 +3070,14 @@ _SCRIPT_UPDATE_()
_SendEMailNotification_ SUCCESS_SCRIPT_UPDATE_STATUS
fi
sleep 1
if [ $# -ge 2 ] && [ "$2" = "unattended" ]
then
return 0
fi

if "$isInteractive" && [ -t 0 ]
if "$isInteractive" && { [ $# -lt 2 ] || [ -z "$2" ] ; }
Comment thread
ExtremeFiretop marked this conversation as resolved.
then
_ReleaseLock_
exec "$ScriptFilePath"
exit 0
else
return 0 #Unattended#
fi
return 0
else
if ! "$isInteractive"
then
Expand DownExpand Up@@ -3200,9 +3204,9 @@ ScriptUpdateFromAMTM()
return "$retCode"
}

##------------------------------------------##
## Modified by ExtremeFiretop [2025-May-10] ##
##------------------------------------------##
##----------------------------------------##
## Modified by Martinski W. [2026-May-21] ##
##----------------------------------------##
_CheckForNewScriptUpdates_()
{
local verStr DLScriptVerPath="${SCRIPT_VERPATH}.DL.tmp"
Expand DownExpand Up@@ -3257,14 +3261,14 @@ _CheckForNewScriptUpdates_()
scriptUpdateNotify="New script update available.
${REDct}v${SCRIPT_VERSION}${NOct} --> ${GRNct}v${DLRepoVersion}${NOct}"
_WriteVarDefToHelperJSFile_ "isScriptUpdateAvailable" "$DLRepoVersion"

if [ $# -gt 0 ] && [ "$1" = "-quietcheck" ]
then
return 0
then return 0
fi
Say "$myLAN_HostName - A new script version update (v$DLRepoVersion) is available to download."
if [ "$ScriptAutoUpdateSetting" = "ENABLED" ]
then
if "$isInteractive" && [ -t 0 ]
if "$isInteractive" && { [ $# -eq 0 ] || [ -z "$1" ] ; }
Comment thread
ExtremeFiretop marked this conversation as resolved.
then
_SCRIPT_UPDATE_ force
else
Expand DownExpand Up@@ -4640,6 +4644,12 @@ _GetKeypressInput_()
local offlineUpdKeyFlag execReloadKeyFlag
local specialKeyCharCodes="12 16 18 24 25 27"

if [ "$isInteractive" = "false" ]
then
theUserInputStr="exit"
return 0 #Defensive Exit#
fi
Comment thread
ExtremeFiretop marked this conversation as resolved.

if [ -n "${offlineUpdTrigger:+xSETx}" ]
then
offlineUpdKeyFlag=true
Expand DownExpand Up@@ -12093,13 +12103,9 @@ FW_NewUpdateVerInit=TBD
if [ $# -eq 0 ] || [ -z "$1" ] || \
{ [ $# -gt 1 ] && [ "$1" = "reload" ] ; }
then
if [ ! -t 0 ]; then
printf "MerlinAU: refusing to open menu without a TTY.\n" >&2
_DoExit_ 1
fi
Comment thread
ExtremeFiretop marked this conversation as resolved.

if ! _AcquireLock_ cliMenuLock
then Say "Exiting..." ; exit 1 ; fi
then Say "Exiting..." ; exit 1
fi

inMenuMode=true
_DoInitializationStartup_
Expand DownExpand Up@@ -12161,7 +12167,7 @@ then
checkupdates)
if _AcquireLock_ cliFileLock
then
_CheckForNewScriptUpdates_
_CheckForNewScriptUpdates_ unattended
Comment thread
ExtremeFiretop marked this conversation as resolved.
_ReleaseLock_ cliFileLock
fi
;;
Expand DownExpand Up@@ -12248,8 +12254,8 @@ then
if _AcquireLock_ cliFileLock
then
if [ "$3" = "${SCRIPT_NAME}scrptupdate_force" ]
then _SCRIPT_UPDATE_ force
else _CheckForNewScriptUpdates_
then _SCRIPT_UPDATE_ force unattended
else _CheckForNewScriptUpdates_ unattended
Comment thread
ExtremeFiretop marked this conversation as resolved.
fi
_ReleaseLock_ cliFileLock
fi
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
# MerlinAU - AsusWRT-Merlin Firmware Auto Updater

## v1.6.2
## 2026-May-20
## v1.6.3
## 2026-May-22

## WebUI:
<img width="775" height="1640" alt="image" src="https://github.com/user-attachments/assets/846f889b-b39f-4ffe-a37a-8892ad9b2f7f" />
Expand Down