Skip to content

Commit 07b2b84

Browse files
Merge pull request #195 from ExtremeFiretop/dev
Dev 1.1.1 as Next Stable Release
2 parents 15369ef + 7a0222d commit 07b2b84

File tree

3 files changed

+49
-41
lines changed

3 files changed

+49
-41
lines changed

MerlinAU.sh

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#
55
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
66
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
7-
# Last Modified: 2024-Apr-07
7+
# Last Modified: 2024-Apr-15
88
###################################################################
99
set -u
1010

11-
readonly SCRIPT_VERSION=1.1.0
11+
readonly SCRIPT_VERSION=1.1.1
1212
readonly SCRIPT_NAME="MerlinAU"
1313

1414
##-------------------------------------##
@@ -2039,15 +2039,15 @@ _TestLoginCredentials_()
20392039
}
20402040

20412041
##----------------------------------------##
2042-
## Modified by Martinski W. [2024-Mar-03] ##
2042+
## Modified by Martinski W. [2024-Apr-15] ##
20432043
##----------------------------------------##
20442044
_GetPasswordInput_()
20452045
{
20462046
local PSWDstrLenMIN=1 PSWDstrLenMAX=64
20472047
local PSWDstring PSWDtmpStr PSWDprompt
20482048
local retCode charNum pswdLength showPSWD
20492049
# Added for TAB keypress debounce #
2050-
local lastTabTime=0 currentTime timeDiff
2050+
local lastTabTime=0 currentTime
20512051

20522052
if [ $# -eq 0 ] || [ -z "$1" ]
20532053
then
@@ -2065,7 +2065,15 @@ _GetPasswordInput_()
20652065
stty "$savedSettings"
20662066
}
20672067

2068-
_showPSWDPrompt_()
2068+
_ShowAsterisks_()
2069+
{
2070+
if [ $# -eq 0 ] || [ "$1" -eq 0 ]
2071+
then echo ""
2072+
else printf "%*s" "$1" ' ' | tr ' ' '*'
2073+
fi
2074+
}
2075+
2076+
_ShowPSWDPrompt_()
20692077
{
20702078
local pswdTemp LENct LENwd
20712079
[ "$showPSWD" = "1" ] && pswdTemp="$PSWDstring" || pswdTemp="$PSWDtmpStr"
@@ -2080,12 +2088,10 @@ _GetPasswordInput_()
20802088
charNum=""
20812089
PSWDstring="$pswdString"
20822090
pswdLength="${#PSWDstring}"
2083-
if [ -z "$PSWDstring" ]
2084-
then PSWDtmpStr=""
2085-
else PSWDtmpStr="$(printf "%*s" "$pswdLength" " " | tr ' ' '*')"
2086-
fi
2087-
echo ; _showPSWDPrompt_
2091+
PSWDtmpStr="$(_ShowAsterisks_ "$pswdLength")"
2092+
echo ; _ShowPSWDPrompt_
20882093

2094+
local savedIFS="$IFS"
20892095
while IFS='' theChar="$(_GetKeypress_)"
20902096
do
20912097
charNum="$(printf "%d" "'$theChar")"
@@ -2119,12 +2125,11 @@ _GetPasswordInput_()
21192125
if [ "$charNum" -eq 9 ]
21202126
then
21212127
currentTime="$(date +%s)"
2122-
timeDiff="$((currentTime - lastTabTime))"
2123-
if [ "$timeDiff" -gt 0 ]
2128+
if [ "$((currentTime - lastTabTime))" -gt 0 ]
21242129
then
21252130
showPSWD="$((! showPSWD))"
2126-
lastTabTime="$currentTime" # Update last TAB press time #
2127-
_showPSWDPrompt_
2131+
lastTabTime="$currentTime" # Update TAB keypress time #
2132+
_ShowPSWDPrompt_
21282133
fi
21292134
continue
21302135
fi
@@ -2134,10 +2139,10 @@ _GetPasswordInput_()
21342139
then
21352140
if [ "$pswdLength" -gt 0 ]
21362141
then
2137-
PSWDtmpStr="${PSWDtmpStr%?}"
21382142
PSWDstring="${PSWDstring%?}"
2139-
pswdLength="$((pswdLength - 1))"
2140-
_showPSWDPrompt_
2143+
pswdLength="${#PSWDstring}"
2144+
PSWDtmpStr="$(_ShowAsterisks_ "$pswdLength")"
2145+
_ShowPSWDPrompt_
21412146
continue
21422147
fi
21432148
fi
@@ -2147,13 +2152,15 @@ _GetPasswordInput_()
21472152
then
21482153
if [ "$pswdLength" -le "$PSWDstrLenMAX" ]
21492154
then
2150-
PSWDtmpStr="${PSWDtmpStr}*"
2151-
pswdLength="$((pswdLength + 1))"
21522155
PSWDstring="${PSWDstring}${theChar}"
2156+
pswdLength="${#PSWDstring}"
2157+
PSWDtmpStr="$(_ShowAsterisks_ "$pswdLength")"
2158+
_ShowPSWDPrompt_
2159+
continue
21532160
fi
2154-
_showPSWDPrompt_
21552161
fi
21562162
done
2163+
IFS="$savedIFS"
21572164

21582165
pswdString="$PSWDstring"
21592166
return "$retCode"
@@ -3008,7 +3015,7 @@ _Set_FW_UpdateCronSchedule_()
30083015
}
30093016

30103017
##------------------------------------------##
3011-
## Modified by ExtremeFiretop [2024-Jan-26] ##
3018+
## Modified by ExtremeFiretop [2024-Apr-13] ##
30123019
##------------------------------------------##
30133020
_CheckNewUpdateFirmwareNotification_()
30143021
{
@@ -3043,7 +3050,10 @@ _CheckNewUpdateFirmwareNotification_()
30433050
fwNewUpdateNotificationDate="$(date +"$FW_UpdateNotificationDateFormat")"
30443051
Update_Custom_Settings FW_New_Update_Notification_Vers "$fwNewUpdateNotificationVers"
30453052
Update_Custom_Settings FW_New_Update_Notification_Date "$fwNewUpdateNotificationDate"
3046-
_SendEMailNotification_ NEW_FW_UPDATE_STATUS
3053+
if "$inRouterSWmode"
3054+
then
3055+
_SendEMailNotification_ NEW_FW_UPDATE_STATUS
3056+
fi
30473057
fi
30483058
fi
30493059

@@ -3052,7 +3062,10 @@ _CheckNewUpdateFirmwareNotification_()
30523062
then
30533063
fwNewUpdateNotificationDate="$(date +"$FW_UpdateNotificationDateFormat")"
30543064
Update_Custom_Settings FW_New_Update_Notification_Date "$fwNewUpdateNotificationDate"
3055-
_SendEMailNotification_ NEW_FW_UPDATE_STATUS
3065+
if "$inRouterSWmode"
3066+
then
3067+
_SendEMailNotification_ NEW_FW_UPDATE_STATUS
3068+
fi
30563069
fi
30573070
return 0
30583071
}
@@ -3427,11 +3440,12 @@ Please manually update to version $minimum_supported_version or higher to use th
34273440

34283441
# Use set to read the output of the function into variables
34293442
set -- $(_GetLatestFWUpdateVersionFromWebsite_ "$FW_URL_RELEASE")
3430-
release_version="$1"
3431-
release_link="$2"
3432-
3433-
if [ "$release_version" = "**ERROR**" ] && [ "$release_link" = "**NO_URL**" ]
3443+
if [ $? -eq 0 ] && [ $# -eq 2 ] && \
3444+
[ "$1" != "**ERROR**" ] && [ "$2" != "**NO_URL**" ]
34343445
then
3446+
release_version="$1"
3447+
release_link="$2"
3448+
else
34353449
Say "${REDct}**ERROR**${NOct}: No firmware release URL was found for [$PRODUCT_ID] router model."
34363450
"$inMenuMode" && _WaitForEnterKey_ "$mainMenuReturnPromptStr"
34373451
return 1
@@ -4729,13 +4743,8 @@ _ProcessMeshNodes_()
47294743
else
47304744
if [ "$includeExtraLogic" -eq 1 ]; then
47314745
printf "\n${padStr}${padStr}${padStr}${REDct}No AiMesh Node(s)${NOct}"
4732-
else
4733-
Say "No AiMesh Node(s). Disabling AiMesh verification."
47344746
fi
47354747
fi
4736-
else
4737-
# Else statement for when not running on primary router #
4738-
Say "Not running on Primary Router. Skipping AiMesh verification."
47394748
fi
47404749
}
47414750

@@ -4853,15 +4862,14 @@ _ShowNodesMenuOptions_()
48534862
# Main Menu loop
48544863
inMenuMode=true
48554864
HIDE_ROUTER_SECTION=false
4865+
if ! node_list="$(_GetNodeIPv4List_)"
4866+
then node_list="" ; fi
48564867

48574868
while true
48584869
do
48594870
# Check if the directory exists again before attempting to navigate to it
48604871
[ -d "$FW_BIN_DIR" ] && cd "$FW_BIN_DIR"
48614872

4862-
if ! node_list="$(_GetNodeIPv4List_)"
4863-
then node_list="" ; fi
4864-
48654873
_ShowMainMenu_
48664874
printf "Enter selection: " ; read -r userChoice
48674875
echo

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# MerlinAU - AsusWRT-Merlin Firmware Auto Updater
2-
## v1.1.0
3-
## 2024-04-8
2+
## v1.1.1
3+
## 2024-04-16
44

5-
![image](https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/assets/1971404/89d65eac-db04-4aa6-a371-66aecc8ca17c)
6-
![image](https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/assets/1971404/6008a0d1-a76e-4e66-bce7-55ffaa0161e3)
7-
![image](https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/assets/1971404/223a0186-c041-4eca-bc8b-bf98fa0d4b7b)
5+
![image](https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/assets/1971404/de7da7bc-ab21-4373-ba17-b075556ada6d)
6+
![image](https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/assets/1971404/d42a7b0d-27f1-4139-9ab2-43b3dd437a9d)
7+
![image](https://github.com/ExtremeFiretop/MerlinAutoUpdate-Router/assets/1971404/93605295-68dd-4bcf-9676-e77beed44427)
88

99
## TESTED MODELS (Multi-image models) - i.e. Any model that uses a .w or a .pkgtb file
1010

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.1.1

0 commit comments

Comments
 (0)