Skip to content

Commit 681fafc

Browse files
Merge pull request #574 from ExtremeFiretop/dev
Dev 1.6.3 as Next Stable Release
2 parents 85f068e + 1581385 commit 681fafc

3 files changed

Lines changed: 46 additions & 26 deletions

File tree

MerlinAU.sh

Lines changed: 43 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +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: 2026-May-16
7+
# Last Modified: 2026-May-21
88
###################################################################
99
set -u
1010

1111
## Set version for each Production Release ##
12-
readonly SCRIPT_VERSION=1.6.2
13-
readonly SCRIPT_VERSTAG="26051600"
12+
readonly SCRIPT_VERSION=1.6.3
13+
readonly SCRIPT_VERSTAG="26052123"
1414
readonly SCRIPT_NAME="MerlinAU"
1515
## Set to "master" for Production Releases ##
1616
SCRIPT_BRANCH="master"
@@ -173,14 +173,28 @@ fi
173173
inMenuMode=true
174174
webguiMode=false
175175
isVerbose=false
176-
isInteractive=false
177176
FlashStarted=false
178177
MerlinChangeLogURL=""
179178
GnutonChangeLogURL=""
180179
keepConfigFile=false
181180
bypassPostponedDays=false
182181
runLoginCredentialsTest=false
183182

183+
if [ -t 0 ] && ! tty | grep -qwi "NOT"
184+
then
185+
isVerbose=true
186+
readonly isInteractive=true
187+
readonly gSavedSTTY="$(stty -g)"
188+
else
189+
readonly isInteractive=false
190+
fi
191+
192+
if [ "$isInteractive" = "false" ] && { [ $# -eq 0 ] || [ -z "$1" ] ; }
193+
then
194+
logger -st "${SCRIPT_NAME}_[$$]" -p 3 "**ERROR**: CLI Menu is NOT available in a non-interactive shell"
195+
exit 1
196+
fi
197+
184198
# Main LAN Network Info #
185199
readonly myLAN_HostName="$(nvram get lan_hostname)"
186200
readonly mainLAN_IFname="$(nvram get lan_ifname)"
@@ -277,12 +291,6 @@ routerLoginFailureMsg="Please try the following:
277291
to restrict access to the router webGUI from the router's IP address [${GRNct}${mainLAN_IPaddr}${NOct}].
278292
3. Confirm your password via the \"Set Router Login Password\" option from the Main Menu."
279293

280-
if [ -t 0 ] && ! tty | grep -qwi "NOT"
281-
then
282-
isInteractive=true ; isVerbose=true
283-
readonly gSavedSTTY="$(stty -g)"
284-
fi
285-
286294
##----------------------------------------##
287295
## Modified by Martinski W. [2023-Dec-23] ##
288296
##----------------------------------------##
@@ -3011,7 +3019,7 @@ _CheckNewScriptMinFWBeforeUpdate_()
30113019
}
30123020

30133021
##----------------------------------------##
3014-
## Modified by Martinski W. [2026-Feb-22] ##
3022+
## Modified by Martinski W. [2026-May-21] ##
30153023
##----------------------------------------##
30163024
_SCRIPT_UPDATE_()
30173025
{
@@ -3062,14 +3070,13 @@ _SCRIPT_UPDATE_()
30623070
_SendEMailNotification_ SUCCESS_SCRIPT_UPDATE_STATUS
30633071
fi
30643072
sleep 1
3065-
if [ $# -lt 2 ] || [ -z "$2" ]
3073+
if "$isInteractive" && { [ $# -lt 2 ] || [ -z "$2" ] ; }
30663074
then
30673075
_ReleaseLock_
30683076
exec "$ScriptFilePath"
30693077
exit 0
3070-
elif [ "$2" = "unattended" ]
3071-
then
3072-
return 0
3078+
else
3079+
return 0 #Unattended#
30733080
fi
30743081
else
30753082
if ! "$isInteractive"
@@ -3197,9 +3204,9 @@ ScriptUpdateFromAMTM()
31973204
return "$retCode"
31983205
}
31993206

3200-
##------------------------------------------##
3201-
## Modified by ExtremeFiretop [2025-May-10] ##
3202-
##------------------------------------------##
3207+
##----------------------------------------##
3208+
## Modified by Martinski W. [2026-May-21] ##
3209+
##----------------------------------------##
32033210
_CheckForNewScriptUpdates_()
32043211
{
32053212
local verStr DLScriptVerPath="${SCRIPT_VERPATH}.DL.tmp"
@@ -3254,13 +3261,19 @@ _CheckForNewScriptUpdates_()
32543261
scriptUpdateNotify="New script update available.
32553262
${REDct}v${SCRIPT_VERSION}${NOct} --> ${GRNct}v${DLRepoVersion}${NOct}"
32563263
_WriteVarDefToHelperJSFile_ "isScriptUpdateAvailable" "$DLRepoVersion"
3264+
32573265
if [ $# -gt 0 ] && [ "$1" = "-quietcheck" ]
32583266
then return 0
32593267
fi
32603268
Say "$myLAN_HostName - A new script version update (v$DLRepoVersion) is available to download."
32613269
if [ "$ScriptAutoUpdateSetting" = "ENABLED" ]
32623270
then
3263-
_SCRIPT_UPDATE_ force
3271+
if "$isInteractive" && { [ $# -eq 0 ] || [ -z "$1" ] ; }
3272+
then
3273+
_SCRIPT_UPDATE_ force
3274+
else
3275+
_SCRIPT_UPDATE_ force unattended
3276+
fi
32643277
fi
32653278
else
32663279
scriptUpdateNotify=0
@@ -4631,6 +4644,12 @@ _GetKeypressInput_()
46314644
local offlineUpdKeyFlag execReloadKeyFlag
46324645
local specialKeyCharCodes="12 16 18 24 25 27"
46334646

4647+
if [ "$isInteractive" = "false" ]
4648+
then
4649+
theUserInputStr="exit"
4650+
return 0 #Defensive Exit#
4651+
fi
4652+
46344653
if [ -n "${offlineUpdTrigger:+xSETx}" ]
46354654
then
46364655
offlineUpdKeyFlag=true
@@ -12085,7 +12104,8 @@ if [ $# -eq 0 ] || [ -z "$1" ] || \
1208512104
{ [ $# -gt 1 ] && [ "$1" = "reload" ] ; }
1208612105
then
1208712106
if ! _AcquireLock_ cliMenuLock
12088-
then Say "Exiting..." ; exit 1 ; fi
12107+
then Say "Exiting..." ; exit 1
12108+
fi
1208912109

1209012110
inMenuMode=true
1209112111
_DoInitializationStartup_
@@ -12147,7 +12167,7 @@ then
1214712167
checkupdates)
1214812168
if _AcquireLock_ cliFileLock
1214912169
then
12150-
_CheckForNewScriptUpdates_
12170+
_CheckForNewScriptUpdates_ unattended
1215112171
_ReleaseLock_ cliFileLock
1215212172
fi
1215312173
;;
@@ -12234,8 +12254,8 @@ then
1223412254
if _AcquireLock_ cliFileLock
1223512255
then
1223612256
if [ "$3" = "${SCRIPT_NAME}scrptupdate_force" ]
12237-
then _SCRIPT_UPDATE_ force
12238-
else _CheckForNewScriptUpdates_
12257+
then _SCRIPT_UPDATE_ force unattended
12258+
else _CheckForNewScriptUpdates_ unattended
1223912259
fi
1224012260
_ReleaseLock_ cliFileLock
1224112261
fi

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# MerlinAU - AsusWRT-Merlin Firmware Auto Updater
22

3-
## v1.6.2
4-
## 2026-May-20
3+
## v1.6.3
4+
## 2026-May-22
55

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

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.6.2
1+
1.6.3

0 commit comments

Comments
 (0)