From 169630f8c2e65c2e2563a1bc10e7c5d6bdc7a3ae Mon Sep 17 00:00:00 2001 From: Martinski4GitHub <119833648+Martinski4GitHub@users.noreply.github.com> Date: Sun, 21 Dec 2025 00:58:09 -0800 Subject: [PATCH 1/2] Update connmon.sh --- connmon.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connmon.sh b/connmon.sh index 96aefd5..d239312 100644 --- a/connmon.sh +++ b/connmon.sh @@ -38,7 +38,7 @@ readonly SCRIPT_NAME="connmon" readonly SCRIPT_VERSION="v3.0.10" readonly SCRIPT_VERSTAG="25121620" -SCRIPT_BRANCH="master" +SCRIPT_BRANCH="develop" SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH" readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME.d" readonly SCRIPT_WEBPAGE_DIR="$(readlink -f /www/user)" From 8384d783fdb325a922d32fd03a7561c4b78a1834 Mon Sep 17 00:00:00 2001 From: Martinski4GitHub <119833648+Martinski4GitHub@users.noreply.github.com> Date: Wed, 18 Feb 2026 01:21:14 -0800 Subject: [PATCH 2/2] New Functionality Initial code to support automatic script updates via AMTM. --- CHANGELOG.md | 4 ++++ README.md | 4 ++-- connmon.sh | 36 +++++++++++++++++++++++++++++++----- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb5a584..c94b907 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v3.0.11 +Updated on 2026-Feb-18 +* NEW: Added code to support automatic add-on updates from AMTM. + ## v3.0.10 Updated on 2025-Dec-21 * FIXED: Bug fix in a CLI shell script function to get the full value of notification parameters from the configuration file. diff --git a/README.md b/README.md index 6c06ef3..8d1ee44 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # connmon -## v3.0.10 -### Updated on 2025-Dec-21 +## v3.0.11 +### Updated on 2026-Feb-18 ## About connmon is an internet connection monitoring tool for AsusWRT Merlin with charts for daily, weekly and monthly summaries. diff --git a/connmon.sh b/connmon.sh index d239312..07ad7e5 100644 --- a/connmon.sh +++ b/connmon.sh @@ -11,7 +11,7 @@ ## Forked from https://github.com/jackyaz/connmon ## ## ## ############################################################## -# Last Modified: 2025-Dec-16 +# Last Modified: 2026-Feb-18 #------------------------------------------------------------- ############## Shellcheck directives ############# @@ -36,8 +36,8 @@ ### Start of script variables ### readonly SCRIPT_NAME="connmon" -readonly SCRIPT_VERSION="v3.0.10" -readonly SCRIPT_VERSTAG="25121620" +readonly SCRIPT_VERSION="v3.0.11" +readonly SCRIPT_VERSTAG="26021800" SCRIPT_BRANCH="develop" SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH" readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME.d" @@ -75,6 +75,9 @@ readonly curlOutLogFile="/tmp/var/tmp/temp_${SCRIPT_NAME}_curl_OUT.LOG" readonly curlErrLogFile="/tmp/var/tmp/temp_${SCRIPT_NAME}_curl_ERR.LOG" readonly tmpCurlSEPstr="-------------------------------------------------------" +# To support automatic script updates from AMTM # +doScriptUpdateFromAMTM=true + # For daily CRON job to trim database # readonly defTrimDB_Hour=3 readonly defTrimDB_Mins=3 @@ -300,7 +303,8 @@ Update_Version() Print_Output true "New version of $SCRIPT_NAME available - $serverver" "$PASS" changelog="$(curl -fsL --retry 4 --retry-delay 5 "$SCRIPT_REPO/CHANGELOG.md" | sed -n "/$serverver"'/,/##/p' | head -n -1 | sed 's/## //')" printf "${BOLD}${UNDERLINE}Changelog\\n${CLEARFORMAT}%s\\n\\n" "$changelog" - elif [ "$isupdate" = "md5" ]; then + elif [ "$isupdate" = "md5" ] + then Print_Output true "MD5 hash of $SCRIPT_NAME does not match - hotfix available - $serverver" "$PASS" fi @@ -365,6 +369,23 @@ Update_Version() fi } +##-------------------------------------## +## Added by Martinski W. [2026-Feb-18] ## +##-------------------------------------## +ScriptUpdateFromAMTM() +{ + if ! "$doScriptUpdateFromAMTM" + then + printf "Automatic script updates via AMTM are currently disabled.\n\n" + return 1 + fi + if [ $# -gt 0 ] && [ "$1" = "check" ] + then return 0 + fi + Update_Version force unattended + return "$?" +} + ##----------------------------------------## ## Modified by Martinski W. [2025-Feb-09] ## ##----------------------------------------## @@ -6352,7 +6373,7 @@ then fi ##----------------------------------------## -## Modified by Martinski W. [2025-Dec-11] ## +## Modified by Martinski W. [2026-Feb-18] ## ##----------------------------------------## case "$1" in install) @@ -6579,6 +6600,11 @@ case "$1" in Update_Version force exit 0 ;; + amtmupdate) + shift + ScriptUpdateFromAMTM "$@" + exit "$?" + ;; postupdate) Create_Dirs Conf_Exists