From cab4fe55fcd2a091b53c9f99e9daa63f8ea8d66d Mon Sep 17 00:00:00 2001 From: Martinski4GitHub <119833648+Martinski4GitHub@users.noreply.github.com> Date: Wed, 5 Nov 2025 21:08:59 -0800 Subject: [PATCH 1/2] Fix for "parameter not set" Error Message Fixed a bug generating a "currentDIVER_version: parameter not set" error message. --- MerlinAU.sh | 63 ++++++++++++++++++++++++++++++----------------------- README.md | 4 ++-- version.txt | 2 +- 3 files changed, 39 insertions(+), 30 deletions(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index 0795466e..93ef4874 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: 2025-Nov-02 +# Last Modified: 2025-Nov-05 ################################################################### set -u ## Set version for each Production Release ## -readonly SCRIPT_VERSION=1.5.5 -readonly SCRIPT_VERSTAG="25110200" +readonly SCRIPT_VERSION=1.5.6 +readonly SCRIPT_VERSTAG="25110520" readonly SCRIPT_NAME="MerlinAU" ## Set to "master" for Production Releases ## SCRIPT_BRANCH="dev" @@ -8773,7 +8773,7 @@ _RunOfflineUpdateNow_() } ##----------------------------------------## -## Modified by Martinski W. [2025-Nov-01] ## +## Modified by Martinski W. [2025-Nov-05] ## ##----------------------------------------## _RunFirmwareUpdateNow_() { @@ -9247,6 +9247,36 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or # Send last email notification before F/W flash # _SendEMailNotification_ START_FW_UPDATE_STATUS + ## To handle stopping and restarting Diversion when needed ## + local DIVER_VERSION currentDIVER_version="" requiredDIVER_version="" + if [ -f /opt/bin/diversion ] + then + DIVER_VERSION="$(grep "^VERSION=" /opt/bin/diversion | awk -F'=' '{print $2}' | tr -d ' ')" + + # Adjust version format from 1.46 to 1.4.6 if needed # + local DDOT_COUNT="$(echo "$DIVER_VERSION" | tr -cd '.' | wc -c)" + if [ "$DDOT_COUNT" -eq 0 ] + then + # If there's no dot, it's a simple version like "1" (unlikely but let's handle it) # + DIVER_VERSION="${DIVER_VERSION}.0.0" + elif [ "$DDOT_COUNT" -eq 1 ] + then + # Check if there is only one character after the dot # + if echo "$DIVER_VERSION" | grep -qE '^[0-9]+\.[0-9]{1}$' + then + # If the version is like 5.2, convert it to 5.2.0 # + DIVER_VERSION="${DIVER_VERSION}.0" + else + # For versions like 5.26, insert a dot between the last two digits # + DIVER_VERSION="$(echo "$DIVER_VERSION" | sed 's/\.\([0-9]\)\([0-9]\)/.\1.\2/')" + fi + fi + + # Convert version strings to numeric values # + currentDIVER_version="$(_ScriptVersionStrToNum_ "$DIVER_VERSION")" + requiredDIVER_version="$(_ScriptVersionStrToNum_ "5.2.0")" + fi + ##------------------------------------------## ## Modified by ExtremeFiretop [2024-Sep-07] ## ##------------------------------------------## @@ -9263,31 +9293,9 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or if echo "$curl_response" | grep -Eq 'url=index\.asp|url=GameDashboard\.asp' then _UpdateLoginPswdCheckHelper_ SUCCESS + if [ -f /opt/bin/diversion ] then - # Extract version number from Diversion - local DIVER_VERSION="$(grep "^VERSION=" /opt/bin/diversion | awk -F'=' '{print $2}' | tr -d ' ')" - - # Adjust version format from 1.46 to 1.4.6 if needed - local DDOT_COUNT="$(echo "$DIVER_VERSION" | tr -cd '.' | wc -c)" - if [ "$DDOT_COUNT" -eq 0 ]; then - # If there's no dot, it's a simple version like "1" (unlikely but let's handle it) - DIVER_VERSION="${DIVER_VERSION}.0.0" - elif [ "$DDOT_COUNT" -eq 1 ]; then - # Check if there is only one character after the dot - if echo "$DIVER_VERSION" | grep -qE '^[0-9]+\.[0-9]{1}$'; then - # If the version is like 5.2, convert it to 5.2.0 - DIVER_VERSION="${DIVER_VERSION}.0" - else - # For versions like 5.26, insert a dot between the last two digits - DIVER_VERSION="$(echo "$DIVER_VERSION" | sed 's/\.\([0-9]\)\([0-9]\)/.\1.\2/')" - fi - fi - - # Convert version strings to comparable numbers - local currentDIVER_version="$(_ScriptVersionStrToNum_ "$DIVER_VERSION")" - local requiredDIVER_version="$(_ScriptVersionStrToNum_ "5.2.0")" - # Diversion unmount command also unloads entware services # Say "Stopping Diversion service..." if [ "$currentDIVER_version" -ge "$requiredDIVER_version" ] @@ -9391,6 +9399,7 @@ Please manually update to version ${GRNct}${MinSupportedFirmwareVers}${NOct} or _SendEMailNotification_ FAILED_FW_UPDATE_STATUS _DoCleanUp_ 1 "$keepZIPfile" "$keepWfile" _EntwareServicesHandler_ start + if [ -f /opt/bin/diversion ] then Say "Restarting Diversion service..." diff --git a/README.md b/README.md index f795c201..e0ba3e0c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # MerlinAU - AsusWRT-Merlin Firmware Auto Updater -## v1.5.5 -## 2025-Nov-02 +## v1.5.6 +## 2025-Nov-05 ## WebUI: ![image](https://github.com/user-attachments/assets/9c1dff99-9c13-491b-a7fa-aff924d5f02e) diff --git a/version.txt b/version.txt index 9075be49..eac1e0ad 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.5.5 +1.5.6 From b129dc8a83fa5cdc9ef57bac6868fe5563091df8 Mon Sep 17 00:00:00 2001 From: Martinski4GitHub <119833648+Martinski4GitHub@users.noreply.github.com> Date: Fri, 7 Nov 2025 18:48:00 -0800 Subject: [PATCH 2/2] Updated for Next Release Updated for next Production Release. --- MerlinAU.sh | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MerlinAU.sh b/MerlinAU.sh index 86910d4e..93ef4874 100644 --- a/MerlinAU.sh +++ b/MerlinAU.sh @@ -13,7 +13,7 @@ readonly SCRIPT_VERSION=1.5.6 readonly SCRIPT_VERSTAG="25110520" readonly SCRIPT_NAME="MerlinAU" ## Set to "master" for Production Releases ## -SCRIPT_BRANCH="master" +SCRIPT_BRANCH="dev" ##----------------------------------------## ## Modified by Martinski W. [2024-Jul-03] ## diff --git a/README.md b/README.md index e0ba3e0c..5a1f879c 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # MerlinAU - AsusWRT-Merlin Firmware Auto Updater ## v1.5.6 -## 2025-Nov-05 +## 2025-Nov-07 ## WebUI: ![image](https://github.com/user-attachments/assets/9c1dff99-9c13-491b-a7fa-aff924d5f02e)