Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
38 changes: 32 additions & 6 deletions connmon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
## Forked from https://github.com/jackyaz/connmon ##
## ##
##############################################################
# Last Modified: 2025-Dec-16
# Last Modified: 2026-Feb-18
#-------------------------------------------------------------

############## Shellcheck directives #############
Expand All @@ -36,9 +36,9 @@

### Start of script variables ###
readonly SCRIPT_NAME="connmon"
readonly SCRIPT_VERSION="v3.0.10"
readonly SCRIPT_VERSTAG="25121620"
SCRIPT_BRANCH="master"
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"
readonly SCRIPT_WEBPAGE_DIR="$(readlink -f /www/user)"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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] ##
##----------------------------------------##
Expand Down Expand Up @@ -6352,7 +6373,7 @@ then
fi

##----------------------------------------##
## Modified by Martinski W. [2025-Dec-11] ##
## Modified by Martinski W. [2026-Feb-18] ##
##----------------------------------------##
case "$1" in
install)
Expand Down Expand Up @@ -6579,6 +6600,11 @@ case "$1" in
Update_Version force
exit 0
;;
amtmupdate)
shift
ScriptUpdateFromAMTM "$@"
exit "$?"
;;
postupdate)
Create_Dirs
Conf_Exists
Expand Down