From 09a4e60efe5b6d5e9355be804a0d768cbbb4a451 Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Mon, 22 Jun 2026 09:48:16 -0400 Subject: [PATCH 1/5] Fix log cleanup function to create directory and restore logs Ensure log directory exists before cleanup and enhance log deletion with restoration attempt. --- MerlinAU.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index 9bc9d03b..3876e7df 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -2250,7 +2250,7 @@ readonly POST_UPDATE_EMAIL_SCRIPT_HOOK="[ -x $ScriptFilePath ] && $POST_UPDATE_E ##------------------------------------------## _CleanUpOldLogFiles_() { - [ ! -d "$FW_LOG_DIR" ] && return 1 + [ ! -d "$FW_LOG_DIR" ] && mkdir -p -m 755 "$FW_LOG_DIR" local numLogFiles topLogFile savedTopLogFile="" numLogFiles="$(ls -1lt "$FW_LOG_DIR"/*.log 2>/dev/null | wc -l)" @@ -2270,7 +2270,18 @@ _CleanUpOldLogFiles_() fi # Delete logs older than 30 days # - /usr/bin/find -L "$FW_LOG_DIR" -name '*.log' -mtime +30 -exec rm {} \; + if ! /usr/bin/find -L "$FW_LOG_DIR" \ + -name '*.log' \ + -mtime +30 \ + -exec rm -f {} \; + then + # Attempt restoration before returning failure. + [ -n "$savedTopLogFile" ] && + [ -e "$savedTopLogFile" ] && + mv -f "$savedTopLogFile" "$topLogFile" 2>/dev/null + + return 1 + fi # Restore the most recent log file # if [ -n "$topLogFile" ] && \ From 28bce8703924bd60129f6e924b15a281d925ff71 Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Mon, 22 Jun 2026 09:51:45 -0400 Subject: [PATCH 2/5] Update script version and branch for development --- MerlinAU.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index 3876e7df..e4b93bbd 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -9,11 +9,11 @@ set -u ## Set version for each Production Release ## -readonly SCRIPT_VERSION=1.6.4 -readonly SCRIPT_VERSTAG="26061118" +readonly SCRIPT_VERSION=1.6.5 +readonly SCRIPT_VERSTAG="26062210" readonly SCRIPT_NAME="MerlinAU" ## Set to "master" for Production Releases ## -SCRIPT_BRANCH="master" +SCRIPT_BRANCH="dev" ##----------------------------------------## ## Modified by Martinski W. [2024-Jul-03] ## From 7a3be17623633388d3b49f69219f9d85fcff8b52 Mon Sep 17 00:00:00 2001 From: Joel Samson Date: Mon, 22 Jun 2026 10:09:21 -0400 Subject: [PATCH 3/5] Update MerlinAU.sh --- MerlinAU.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index e4b93bbd..7af4855e 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -2250,7 +2250,11 @@ readonly POST_UPDATE_EMAIL_SCRIPT_HOOK="[ -x $ScriptFilePath ] && $POST_UPDATE_E ##------------------------------------------## _CleanUpOldLogFiles_() { - [ ! -d "$FW_LOG_DIR" ] && mkdir -p -m 755 "$FW_LOG_DIR" + # Create the log directory on a fresh installation. + if [ ! -d "$FW_LOG_DIR" ] + then + mkdir -p -m 755 "$FW_LOG_DIR" 2>/dev/null || return 1 + fi local numLogFiles topLogFile savedTopLogFile="" numLogFiles="$(ls -1lt "$FW_LOG_DIR"/*.log 2>/dev/null | wc -l)" From 6fbec6f3aee493bbde6e3f32d4f20dcfb8c987c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 23:42:50 +0000 Subject: [PATCH 4/5] Bump the all-actions group with 2 updates Bumps the all-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [softprops/action-gh-release](https://github.com/softprops/action-gh-release). Updates `actions/checkout` from 6.0.3 to 7.0.0 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6.0.3...v7.0.0) Updates `softprops/action-gh-release` from 3.0.0 to 3.0.1 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v3.0.0...v3.0.1) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: all-actions - dependency-name: softprops/action-gh-release dependency-version: 3.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/Create-NewReleases.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Create-NewReleases.yml b/.github/workflows/Create-NewReleases.yml index 3000045d..cc045d95 100644 --- a/.github/workflows/Create-NewReleases.yml +++ b/.github/workflows/Create-NewReleases.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout source code - uses: actions/checkout@v6.0.3 + uses: actions/checkout@v7.0.0 with: fetch-depth: 0 ref: 'main' # Ensure we're tagging the main branch after the merge @@ -85,7 +85,7 @@ jobs: git push origin ${{ steps.nextver.outputs.tag }} - name: Create Release with Automated Release Notes - uses: softprops/action-gh-release@v3.0.0 + uses: softprops/action-gh-release@v3.0.1 with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ steps.nextver.outputs.tag }} From 58f253929edd653d6e0dd9c7e08dc7bd0bd9c98f Mon Sep 17 00:00:00 2001 From: Martinski4GitHub <119833648+Martinski4GitHub@users.noreply.github.com> Date: Tue, 23 Jun 2026 01:21:27 -0700 Subject: [PATCH 5/5] Improvements and Clean Up Cleaned up and improved code. --- MerlinAU.sh | 34 ++++++++++------------------------ README.md | 4 ++-- version.txt | 2 +- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index 7af4855e..ad9aec4d 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -4,13 +4,13 @@ # # Original Creation Date: 2023-Oct-01 by @ExtremeFiretop. # Official Co-Author: @Martinski W. - Date: 2023-Nov-01 -# Last Modified: 2026-Jun-11 +# Last Modified: 2026-Jun-23 ################################################################### set -u ## Set version for each Production Release ## readonly SCRIPT_VERSION=1.6.5 -readonly SCRIPT_VERSTAG="26062210" +readonly SCRIPT_VERSTAG="26062300" readonly SCRIPT_NAME="MerlinAU" ## Set to "master" for Production Releases ## SCRIPT_BRANCH="dev" @@ -2245,17 +2245,13 @@ readonly POST_REBOOT_SCRIPT_HOOK="[ -x $ScriptFilePath ] && $POST_REBOOT_SCRIPT_ readonly POST_UPDATE_EMAIL_SCRIPT_JOB="$ScriptFilePath postUpdateEmail &" readonly POST_UPDATE_EMAIL_SCRIPT_HOOK="[ -x $ScriptFilePath ] && $POST_UPDATE_EMAIL_SCRIPT_JOB $hookScriptTagStr" -##------------------------------------------## -## Modified by ExtremeFiretop [2026-Jun-10] ## -##------------------------------------------## +##----------------------------------------## +## Modified by Martinski W. [2026-Jun-23] ## +##----------------------------------------## _CleanUpOldLogFiles_() { - # Create the log directory on a fresh installation. - if [ ! -d "$FW_LOG_DIR" ] - then - mkdir -p -m 755 "$FW_LOG_DIR" 2>/dev/null || return 1 - fi - local numLogFiles topLogFile savedTopLogFile="" + [ ! -d "$FW_LOG_DIR" ] && return 0 + local retCode numLogFiles topLogFile savedTopLogFile="" numLogFiles="$(ls -1lt "$FW_LOG_DIR"/*.log 2>/dev/null | wc -l)" # Leave one log file (if any available) # @@ -2274,18 +2270,8 @@ _CleanUpOldLogFiles_() fi # Delete logs older than 30 days # - if ! /usr/bin/find -L "$FW_LOG_DIR" \ - -name '*.log' \ - -mtime +30 \ - -exec rm -f {} \; - then - # Attempt restoration before returning failure. - [ -n "$savedTopLogFile" ] && - [ -e "$savedTopLogFile" ] && - mv -f "$savedTopLogFile" "$topLogFile" 2>/dev/null - - return 1 - fi + /usr/bin/find -L "$FW_LOG_DIR" -name '*.log' -mtime +30 -exec rm {} \; + retCode="$?" # Restore the most recent log file # if [ -n "$topLogFile" ] && \ @@ -2297,7 +2283,7 @@ _CleanUpOldLogFiles_() return 1 fi fi - return 0 + return "$retCode" } ##----------------------------------------## diff --git a/README.md b/README.md index 26f58ecd..607551e8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # MerlinAU - AsusWRT-Merlin Firmware Auto Updater -## v1.6.4 -## 2026-June-21 +## v1.6.5 +## 2026-June-23 ## WebUI: image diff --git a/version.txt b/version.txt index 9edc58bb..9f05f9f2 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.6.4 +1.6.5