From 1518bc8eee94802c0fa1075ce0fb789c9d03df29 Mon Sep 17 00:00:00 2001 From: ExtremeFiretop Date: Tue, 17 Jun 2025 05:05:12 -0400 Subject: [PATCH 1/5] Fix Matches in Emails Fix Matches in Emails --- MerlinAU.sh | 57 ++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index eccfe088..40851141 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -4,12 +4,12 @@ # # Original Creation Date: 2023-Oct-01 by @ExtremeFiretop. # Official Co-Author: @Martinski W. - Date: 2023-Nov-01 -# Last Modified: 2025-Jun-08 +# Last Modified: 2025-Jun-17 ################################################################### set -u ## Set version for each Production Release ## -readonly SCRIPT_VERSION=1.4.8 +readonly SCRIPT_VERSION=1.4.9 readonly SCRIPT_NAME="MerlinAU" ## Set to "master" for Production Releases ## SCRIPT_BRANCH="master" @@ -3033,9 +3033,9 @@ _GetLatestFWUpdateVersionFromRouter_() echo "$newVersionStr" ; return "$retCode" } -##----------------------------------------## -## Modified by Martinski W. [2024-Apr-14] ## -##----------------------------------------## +##------------------------------------------## +## Modified by ExtremeFiretop [2025-Jun-17] ## +##------------------------------------------## _CreateEMailContent_() { if [ $# -eq 0 ] || [ -z "$1" ] ; then return 1 ; fi @@ -3136,35 +3136,34 @@ _CreateEMailContent_() ;; STOP_FW_UPDATE_APPROVAL) emailBodyTitle="WARNING" + high_risk_regex=$(printf '%s\n' "$high_risk_terms" | sed 's/ /[[:space:]]+/g') if "$isEMailFormatHTML" then # Highlight high-risk terms using HTML with a yellow background # - highlighted_changelog_contents="$(echo "$changelog_contents" | sed -E "s/($high_risk_terms)/\1<\/span>/gi")" + highlighted_changelog_contents="$( + printf '%s\n' "$changelog_contents" | + sed -E ":a;N;\$!ba; \ + s/(${high_risk_regex})/\\1<\\/span>/Ig" + )" else # Step 1: Enclose matched terms with unique markers that don't conflict with '>' and '<' - highlighted_changelog_contents="$(echo "$changelog_contents" | sed -E "s/($high_risk_terms)/\[\[UPPER\]\]\1\[\[ENDUPPER\]\]/gi")" - - # Step 2: Modify the awk script with correct marker lengths - highlighted_changelog_contents="$(echo "$highlighted_changelog_contents" | awk ' - BEGIN { - upper_marker = "[[UPPER]]" - endupper_marker = "[[ENDUPPER]]" - upper_marker_length = length(upper_marker) - endupper_marker_length = length(endupper_marker) - } - { - while (match($0, /\[\[UPPER\]\][^\[]*\[\[ENDUPPER\]\]/)) { - prefix = substr($0, 1, RSTART - 1) - match_text_start = RSTART + upper_marker_length - match_text_length = RLENGTH - upper_marker_length - endupper_marker_length - match_text = substr($0, match_text_start, match_text_length) - suffix = substr($0, RSTART + RLENGTH) - match_text_upper = toupper(match_text) - $0 = prefix ">" match_text_upper "<" suffix - } - print - } - ')" + highlighted_changelog_contents="$( + printf '%s\n' "$changelog_contents" | + awk -v regex="$high_risk_regex" ' + BEGIN { IGNORECASE = 1 } + { buf = buf $0 ORS } # slurp into buf + END { + out = "" + while (match(buf, regex)) { + pre = substr(buf, 1, RSTART - 1) + hit = substr(buf, RSTART, RLENGTH) + buf = substr(buf, RSTART + RLENGTH) # delete hit + prefix + out = out pre ">" toupper(hit) "<" # grow output + } + out = out buf # tail with no more matches + printf "%s", out + }' + )" fi { echo "Found high-risk phrases in the changelog file while Auto-Updating to version ${fwNewUpdateVersion} on the ${MODEL_ID} router." From f4eb68d6d6a15f6c1288007e22eacdd2f4b66a5a Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Tue, 17 Jun 2025 06:38:08 -0400 Subject: [PATCH 2/5] Update version.txt --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index b2e46d18..4ea2b1f4 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.4.8 +1.4.9 From 070d07e40e4b6cc293c27d7c2def069ff6527dbb Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Tue, 17 Jun 2025 06:38:42 -0400 Subject: [PATCH 3/5] Update MerlinAU.sh --- MerlinAU.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index 40851141..e020ecd1 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -12,7 +12,7 @@ set -u readonly SCRIPT_VERSION=1.4.9 readonly SCRIPT_NAME="MerlinAU" ## Set to "master" for Production Releases ## -SCRIPT_BRANCH="master" +SCRIPT_BRANCH="dev" ##----------------------------------------## ## Modified by Martinski W. [2024-Jul-03] ## From b8e0aeb25f12d99f04c9974aab3eccd48319790a Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Tue, 17 Jun 2025 06:40:45 -0400 Subject: [PATCH 4/5] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f875445c..e0268466 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MerlinAU - AsusWRT-Merlin Firmware Auto Updater -## v1.4.8 -## 2025-Jun-08 +## v1.4.9 +## 2025-Jun-17 ## WebUI: ![image](https://github.com/user-attachments/assets/9c1dff99-9c13-491b-a7fa-aff924d5f02e) From aad53c1fad634562d760bac8c98b0072819eacad Mon Sep 17 00:00:00 2001 From: ExtremeFiretop Date: Tue, 17 Jun 2025 23:20:30 -0400 Subject: [PATCH 5/5] Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..50acc130 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false # removes the “blank issue” option \ No newline at end of file