Skip to content
Merged
4 changes: 2 additions & 2 deletions .github/workflows/Create-NewReleases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
steps:
# 1--- Check out master so we tag the exact merge commit
- name: Checkout source code
uses: actions/checkout@v6.0.1
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
ref: 'master'
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

# 7--- Publish a GitHub Release with auto-generated notes
- name: Create Release with Automated Release Notes
uses: softprops/action-gh-release@v2.5.0
uses: softprops/action-gh-release@v2.6.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ steps.nextver.outputs.tag }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# spdMerlin

## v4.4.17
### Updated on 2026-Jan-05
## v4.4.18
### Updated on 2026-Mar-21

## About
spdMerlin is an internet speedtest and monitoring tool for AsusWRT Merlin with charts for daily, weekly and monthly summaries. It tracks download/upload bandwidth as well as latency, jitter and packet loss.
Expand Down
57 changes: 45 additions & 12 deletions spdmerlin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
## Forked from https://github.com/jackyaz/spdMerlin ##
## ##
##############################################################
# Last Modified: 2026-Jan-05
# Last Modified: 2026-Mar-21
#-------------------------------------------------------------

############## Shellcheck directives #############
Expand All @@ -38,9 +38,9 @@
### Start of script variables ###
readonly SCRIPT_NAME="spdMerlin"
readonly SCRIPT_NAME_LOWER="$(echo "$SCRIPT_NAME" | tr 'A-Z' 'a-z')"
readonly SCRIPT_VERSION="v4.4.17"
readonly SCRIPT_VERSTAG="26010522"
SCRIPT_BRANCH="master"
readonly SCRIPT_VERSION="v4.4.18"
readonly SCRIPT_VERSTAG="26032122"
SCRIPT_BRANCH="develop"
SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH"
readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME_LOWER.d"
readonly SCRIPT_WEBPAGE_DIR="$(readlink -f /www/user)"
Expand Down Expand Up @@ -75,6 +75,9 @@ readonly branchxStr_TAG="[Branch: $SCRIPT_BRANCH]"
readonly versionDev_TAG="${SCRIPT_VERSION}_${SCRIPT_VERSTAG}"
readonly versionMod_TAG="$SCRIPT_VERSION on $ROUTER_MODEL"

# To support automatic script updates from AMTM #
doScriptUpdateFromAMTM=true

# For daily CRON job to trim database #
readonly defTrimDB_Hour=3
readonly defTrimDB_Mins=5
Expand Down Expand Up @@ -314,9 +317,11 @@ Update_Version()
localver="$(echo "$updatecheckresult" | cut -f2 -d',')"
serverver="$(echo "$updatecheckresult" | cut -f3 -d',')"

if [ "$isupdate" = "version" ]; then
if [ "$isupdate" = "version" ]
then
Print_Output true "New version of $SCRIPT_NAME available - $serverver" "$PASS"
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 @@ -382,6 +387,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 "$?"
}

##-------------------------------------##
## Added by Martinski W. [2025-Jun-11] ##
##-------------------------------------##
Expand Down Expand Up @@ -3968,11 +3990,17 @@ Generate_LastXResults()
if [ $# -gt 1 ] && [ -n "$2" ] ; then glxIndx="$2" ; fi

{
echo ".mode csv"
echo ".output /tmp/spdMerlin-lastx.csv"
echo "PRAGMA temp_store=1;"
echo "SELECT [Timestamp],[Download],[Upload],[Latency],[Jitter],[PktLoss],[DataDownload],[DataUpload],[ResultURL],[ServerID],[ServerName] FROM spdstats_$1 ORDER BY [Timestamp] DESC LIMIT $(LastXResults check);"
} > /tmp/spdMerlin-lastx.sql
echo ".mode csv"
echo ".output /tmp/spdMerlin-lastx.csv"
echo "PRAGMA temp_store=1;"
echo "SELECT [Timestamp],"
echo "printf('%.2f', Download) AS DownloadValue,"
echo "printf('%.2f', Upload) AS UploadValue,"
echo "printf('%.2f', Latency) AS LatencyValue,"
echo "printf('%.2f', Jitter) AS JitterValue,"
echo "[PktLoss],[DataDownload],[DataUpload],[ResultURL],[ServerID],[ServerName]"
echo "FROM spdstats_$1 ORDER BY [Timestamp] DESC LIMIT $(LastXResults check);"
} > /tmp/spdMerlin-lastx.sql
_ApplyDatabaseSQLCmds_ /tmp/spdMerlin-lastx.sql "glx$glxIndx"
rm -f /tmp/spdMerlin-lastx.sql

Expand Down Expand Up @@ -6810,7 +6838,7 @@ then
fi

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