Skip to content

Commit 8854210

Browse files
Merge pull request #454 from Martinski4GitHub/dev
Fix and Improvements
2 parents 299ad79 + 149b1c8 commit 8854210

3 files changed

Lines changed: 38 additions & 31 deletions

File tree

MerlinAU.sh

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3834,17 +3834,15 @@ _CheckForMinimumVersionSupport_()
38343834
}
38353835

38363836
##----------------------------------------##
3837-
## Modified by Martinski W. [2025-Jan-05] ##
3837+
## Modified by Martinski W. [2025-Apr-11] ##
38383838
##----------------------------------------##
38393839
_CheckForMinimumModelSupport_()
38403840
{
3841-
# List of unsupported models as a space-separated string
3841+
# List of UNSUPPORTED models as a space-separated string #
38423842
local unsupported_models="RT-AC87U RT-AC56U RT-AC66U RT-AC3200 RT-AC88U RT-AC5300 RT-AC3100 RT-AC68U RT-AC66U_B1 RT-AC68UF RT-AC68P RT-AC1900P RT-AC1900 RT-N66U RT-N16 DSL-AC68U"
38433843

3844-
local current_model="$(_GetRouterProductID_)"
3845-
3846-
# Check if current model is in the list of unsupported models #
3847-
if echo "$unsupported_models" | grep -wq "$current_model"
3844+
# Check if current router is UNSUPPORTED #
3845+
if echo "$unsupported_models" | grep -wq "$PRODUCT_ID"
38483846
then routerModelCheckFailed=true ; fi
38493847

38503848
"$routerModelCheckFailed" && return 1 || return 0
@@ -7597,7 +7595,8 @@ _CheckNewUpdateFirmwareNotification_()
75977595
fi
75987596

75997597
fwNewUpdateNotificationDate="$(Get_Custom_Setting FW_New_Update_Notification_Date)"
7600-
if [ -z "$fwNewUpdateNotificationDate" ] || [ "$fwNewUpdateNotificationDate" = "TBD" ]
7598+
if [ -z "$fwNewUpdateNotificationDate" ] || \
7599+
[ "$fwNewUpdateNotificationDate" = "TBD" ]
76017600
then
76027601
fwNewUpdateNotificationDate="$(date +"$FW_UpdateNotificationDateFormat")"
76037602
Update_Custom_Settings FW_New_Update_Notification_Date "$fwNewUpdateNotificationDate"
@@ -9300,9 +9299,9 @@ _DelScriptAutoUpdateHook_()
93009299
fi
93019300
}
93029301

9303-
##-------------------------------------##
9304-
## Added by Martinski W. [2025-Jan-05] ##
9305-
##-------------------------------------##
9302+
##----------------------------------------##
9303+
## Modified by Martinski W. [2025-Apr-11] ##
9304+
##----------------------------------------##
93069305
_CheckForMinimumRequirements_()
93079306
{
93089307
local requirementsCheckOK=true
@@ -9343,7 +9342,10 @@ _CheckForMinimumRequirements_()
93439342
Say "\nThe NVRAM Custom JFFS Scripts option was ${GRNct}ENABLED${NOct}.\n"
93449343
fi
93459344

9346-
"$requirementsCheckOK" && return 0 || return 1
9345+
"$requirementsCheckOK" && return 0
9346+
9347+
rm -f "$CONFIG_FILE"
9348+
return 1
93479349
}
93489350

93499351
##-------------------------------------##
@@ -9404,7 +9406,7 @@ _DoInstallation_()
94049406
}
94059407

94069408
##----------------------------------------##
9407-
## Modified by Martinski W. [2025-Jan-22] ##
9409+
## Modified by Martinski W. [2025-Apr-11] ##
94089410
##----------------------------------------##
94099411
_DoUnInstallation_()
94109412
{
@@ -9416,11 +9418,14 @@ _DoUnInstallation_()
94169418

94179419
local savedCFGPath="${SCRIPTS_PATH}/${SCRIPT_NAME}_CFG.SAVED.TXT"
94189420

9419-
printf "\n${BOLDct}Do you want to keep/save the $SCRIPT_NAME configuration file${NOct}"
9420-
if _WaitForYESorNO_ "$("$keepConfigFile" && echo YES || echo NO)"
9421+
if [ -f "$CONFIG_FILE" ]
94219422
then
9422-
keepConfigFile=true
9423-
mv -f "$CONFIG_FILE" "$savedCFGPath"
9423+
printf "\n${BOLDct}Do you want to keep/save the $SCRIPT_NAME configuration file${NOct}"
9424+
if _WaitForYESorNO_ "$("$keepConfigFile" && echo YES || echo NO)"
9425+
then
9426+
keepConfigFile=true
9427+
mv -f "$CONFIG_FILE" "$savedCFGPath"
9428+
fi
94249429
fi
94259430

94269431
_DelFWAutoUpdateHook_
@@ -9803,12 +9808,12 @@ _EnableFWAutoUpdateChecks_()
98039808
}
98049809

98059810
##----------------------------------------##
9806-
## Modified by Martinski W. [2025-Jan-12] ##
9811+
## Modified by Martinski W. [2025-Apr-11] ##
98079812
##----------------------------------------##
98089813
_ConfirmCronJobForFWAutoUpdates_()
98099814
{
98109815
if [ $# -gt 0 ] && [ -n "$1" ] && \
9811-
echo "$1" | grep -qE "^(install|startup)$"
9816+
echo "$1" | grep -qE "^(install|startup|uninstall)$"
98129817
then return 1 ; fi
98139818

98149819
# Check if the PREVIOUS Cron Job ID already exists #
@@ -10832,14 +10837,22 @@ _MainMenu_()
1083210837
done
1083310838
}
1083410839

10835-
##------------------------------------------##
10836-
## Modified by ExtremeFiretop [2025-Jan-15] ##
10837-
##------------------------------------------##
10840+
##----------------------------------------##
10841+
## Modified by Martinski W. [2025-Apr-11] ##
10842+
##----------------------------------------##
1083810843
_DoInitializationStartup_()
1083910844
{
10845+
local theParam=""
10846+
if [ $# -gt 0 ] && [ -n "$1" ] ; then theParam="$1" ; fi
1084010847

10841-
if [ $# -gt 0 ] && [ -n "$1" ] && \
10842-
echo "$1" | grep -qE "^(install|startup)$"
10848+
if ! _CheckForMinimumRequirements_ && [ "$theParam" != "uninstall" ]
10849+
then
10850+
printf "\n${CRITct}Minimum requirements for $SCRIPT_NAME were not met. See the reason(s) above.${NOct}\n"
10851+
_DoExit_ 1
10852+
fi
10853+
10854+
if [ -n "$theParam" ] && \
10855+
echo "$theParam" | grep -qE "^(install|startup|uninstall)$"
1084310856
then return 1 ; fi
1084410857

1084510858
_CreateDirPaths_
@@ -10855,12 +10868,6 @@ _DoInitializationStartup_()
1085510868
_AutoServiceEvent_ create 2>/dev/null
1085610869
fi
1085710870

10858-
if ! _CheckForMinimumRequirements_
10859-
then
10860-
printf "\n${CRITct}Minimum requirements for $SCRIPT_NAME were not met. See the reason(s) above.${NOct}\n"
10861-
return 1
10862-
fi
10863-
1086410871
_CheckAndSetBackupOption_
1086510872
_SetDefaultBuildType_
1086610873
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MerlinAU - AsusWRT-Merlin Firmware Auto Updater
22
## v1.4.2
3-
## 2025-Apr-09
3+
## 2025-Apr-11
44

55
## WebUI:
66
![image](https://github.com/user-attachments/assets/92701007-a902-4724-9bae-b255856a686a)

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
1.4.2
2-
25040922
2+
25041102

0 commit comments

Comments
 (0)