From 46d4f90dd64416749ee31cf30f4943a8f6c97be5 Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Fri, 11 Apr 2025 01:27:45 -0400 Subject: [PATCH 1/3] Patch Changelog and Email Notifications Patch Changelog and Email Notifications --- MerlinAU.sh | 73 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index 5b1d9498..ccbc4781 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -4,7 +4,7 @@ # # Original Creation Date: 2023-Oct-01 by @ExtremeFiretop. # Official Co-Author: @Martinski W. - Date: 2023-Nov-01 -# Last Modified: 2025-Apr-09 +# Last Modified: 2025-Apr-11 ################################################################### set -u @@ -7196,9 +7196,9 @@ _Toggle_ScriptAutoUpdate_Config_() return "$retCode" } -##----------------------------------------## -## Modified by Martinski W. [2024-May-31] ## -##----------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Apr-11] ## +##------------------------------------------## _high_risk_phrases_interactive_() { local changelog_contents="$1" @@ -7232,9 +7232,8 @@ _high_risk_phrases_interactive_() Say "*WARNING*: Found high-risk phrases in the changelog file." Say "Please run script interactively to approve the firmware update." Update_Custom_Settings "FW_New_Update_Changelog_Approval" "BLOCKED" - _SendEMailNotification_ STOP_FW_UPDATE_APPROVAL _DoCleanUp_ 1 - _DoExit_ 1 + return 1 fi fi else @@ -7384,9 +7383,9 @@ _ChangelogVerificationCheck_() fi } -##----------------------------------------## -## Modified by Martinski W. [2024-Nov-18] ## -##----------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Apr-11] ## +##------------------------------------------## _ManageChangelogMerlin_() { if [ $# -eq 0 ] || [ -z "$1" ] @@ -7447,7 +7446,16 @@ _ManageChangelogMerlin_() else if [ "$mode" = "download" ] then - _ChangelogVerificationCheck_ "auto" + if ! "$FlashStarted" + then + _ChangelogVerificationCheck_ "auto" + else + if ! _ChangelogVerificationCheck_ "interactive" + then + _SendEMailNotification_ STOP_FW_UPDATE_APPROVAL + return 1 + fi + fi elif [ "$mode" = "view" ] then clear @@ -7465,9 +7473,9 @@ _ManageChangelogMerlin_() return 0 } -##----------------------------------------## -## Modified by Martinski W. [2024-Nov-18] ## -##----------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Apr-11] ## +##------------------------------------------## _ManageChangelogGnuton_() { if [ $# -eq 0 ] || [ -z "$1" ] @@ -7508,7 +7516,16 @@ _ManageChangelogGnuton_() else if [ "$mode" = "download" ] then - _ChangelogVerificationCheck_ "auto" + if ! "$FlashStarted" + then + _ChangelogVerificationCheck_ "auto" + else + if ! _ChangelogVerificationCheck_ "interactive" + then + _SendEMailNotification_ STOP_FW_UPDATE_APPROVAL + return 1 + fi + fi elif [ "$mode" = "view" ] then clear @@ -7525,9 +7542,9 @@ _ManageChangelogGnuton_() return 0 } -##----------------------------------------## -## Modified by Martinski W. [2025-Jan-10] ## -##----------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Apr-11] ## +##------------------------------------------## _CheckNewUpdateFirmwareNotification_() { if [ $# -lt 2 ] || [ -z "$1" ] || [ -z "$2" ] @@ -7570,14 +7587,11 @@ _CheckNewUpdateFirmwareNotification_() Update_Custom_Settings FW_New_Update_Notification_Vers "$fwNewUpdateNotificationVers" Update_Custom_Settings FW_New_Update_Notification_Date "$fwNewUpdateNotificationDate" "$mountWebGUI_OK" && sendNewUpdateStatusEmail=true - if ! "$FlashStarted" + if "$isGNUtonFW" then - if "$isGNUtonFW" - then - _ManageChangelogGnuton_ "download" - else - _ManageChangelogMerlin_ "download" "$fwNewUpdateNotificationVers" - fi + _ManageChangelogGnuton_ "download" + else + _ManageChangelogMerlin_ "download" "$fwNewUpdateNotificationVers" fi fi fi @@ -7588,14 +7602,11 @@ _CheckNewUpdateFirmwareNotification_() fwNewUpdateNotificationDate="$(date +"$FW_UpdateNotificationDateFormat")" Update_Custom_Settings FW_New_Update_Notification_Date "$fwNewUpdateNotificationDate" "$mountWebGUI_OK" && sendNewUpdateStatusEmail=true - if ! "$FlashStarted" + if "$isGNUtonFW" then - if "$isGNUtonFW" - then - _ManageChangelogGnuton_ "download" - else - _ManageChangelogMerlin_ "download" "$fwNewUpdateNotificationVers" - fi + _ManageChangelogGnuton_ "download" + else + _ManageChangelogMerlin_ "download" "$fwNewUpdateNotificationVers" fi fi From 789254e40a68ccd3b071aba0f0e29d2751f58b88 Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Fri, 11 Apr 2025 02:07:36 -0400 Subject: [PATCH 2/3] Update MerlinAU.sh --- MerlinAU.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index ccbc4781..d5a6f23a 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -3841,7 +3841,7 @@ _CheckForMinimumModelSupport_() # List of unsupported models as a space-separated string 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" - local current_model="$(_GetRouterProductID_)" + local current_model="RT-AC66U" # Check if current model is in the list of unsupported models # if echo "$unsupported_models" | grep -wq "$current_model" @@ -10837,11 +10837,6 @@ _MainMenu_() ##-------------------------------------## _DoInitializationStartup_() { - if ! _CheckForMinimumRequirements_ - then - printf "\n${CRITct}Minimum requirements for $SCRIPT_NAME were not met. See the reason(s) above.${NOct}\n" - _DoExit_ 1 - fi if [ $# -gt 0 ] && [ -n "$1" ] && \ echo "$1" | grep -qE "^(install|startup)$" @@ -10860,6 +10855,12 @@ _DoInitializationStartup_() _AutoServiceEvent_ create 2>/dev/null fi + if ! _CheckForMinimumRequirements_ + then + printf "\n${CRITct}Minimum requirements for $SCRIPT_NAME were not met. See the reason(s) above.${NOct}\n" + return 1 + fi + _CheckAndSetBackupOption_ _SetDefaultBuildType_ } From ab43a44ff352ce33801d7932aec181836e1e1396 Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Fri, 11 Apr 2025 02:10:04 -0400 Subject: [PATCH 3/3] Update MerlinAU.sh --- MerlinAU.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index d5a6f23a..19b75d4a 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -3841,7 +3841,7 @@ _CheckForMinimumModelSupport_() # List of unsupported models as a space-separated string 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" - local current_model="RT-AC66U" + local current_model="$(_GetRouterProductID_)" # Check if current model is in the list of unsupported models # if echo "$unsupported_models" | grep -wq "$current_model" @@ -10832,9 +10832,9 @@ _MainMenu_() done } -##-------------------------------------## -## Added by Martinski W. [2025-Jan-15] ## -##-------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Jan-15] ## +##------------------------------------------## _DoInitializationStartup_() {