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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# spdMerlin

## v4.4.15
### Updated on 2025-Oct-30
### Updated on 2025-Nov-04

## 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
26 changes: 18 additions & 8 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: 2025-Oct-30
# Last Modified: 2025-Nov-04
#-------------------------------------------------------------

############## Shellcheck directives #############
Expand All @@ -39,7 +39,7 @@
readonly SCRIPT_NAME="spdMerlin"
readonly SCRIPT_NAME_LOWER="$(echo "$SCRIPT_NAME" | tr 'A-Z' 'a-z')"
readonly SCRIPT_VERSION="v4.4.15"
readonly SCRIPT_VERSTAG="25103023"
readonly SCRIPT_VERSTAG="25110400"
SCRIPT_BRANCH="develop"
SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH"
readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME_LOWER.d"
Expand Down Expand Up @@ -157,7 +157,7 @@ Print_Output()
"$PASS") prioNum=6 ;; #INFO#
*) prioNum=5 ;; #NOTICE#
esac
logger -t "$SCRIPT_NAME" -p $prioNum "$2"
logger -t "${SCRIPT_NAME}_[$$]" -p $prioNum "$2"
fi
printf "${BOLD}${3}%s${CLEARFORMAT}\n\n" "$2"
}
Expand All @@ -172,8 +172,13 @@ Firmware_Version_Check()
}

### Code for these functions inspired by https://github.com/Adamm00 - credit to @Adamm ###
##----------------------------------------##
## Modified by Martinski W. [2025-Nov-03] ##
##----------------------------------------##
Check_Lock()
{
local doExit=false

if [ -f "/tmp/$SCRIPT_NAME.lock" ]
then
ageoflock="$(($(/bin/date "+%s") - $(/bin/date "+%s" -r "/tmp/$SCRIPT_NAME.lock")))"
Expand All @@ -185,18 +190,23 @@ Check_Lock()
echo "$$" > "/tmp/$SCRIPT_NAME.lock"
return 0
else
Print_Output true "Lock file found (age: $ageoflock seconds) - stopping to prevent duplicate runs" "$ERR"
if [ $# -eq 0 ] || [ -z "$1" ]
then
exit 1
doExit=true
else
if [ "$1" = "webui" ]
then
echo 'var spdteststatus = "LOCKED";' > /tmp/detect_spdtest.js
exit 1
doExit=true
fi
return 1
fi
if "$doExit"
then
Print_Output true "Lock file found (age: $ageoflock seconds) - stopping to prevent duplicate runs" "$ERR"
exit 1
fi
Print_Output true "Lock file found (age: $ageoflock seconds)" "$WARN"
return 1
fi
else
echo "$$" > "/tmp/$SCRIPT_NAME.lock"
Expand Down Expand Up @@ -2855,7 +2865,7 @@ _JFFS_WarnLowFreeSpace_()
then
JFFS_WarningLogTime update "$currTimeSecs"
logMsgStr="${logTagStr} JFFS Available Free Space ($1) is getting LOW."
logger -t "$SCRIPT_NAME" -p $logPriNum "$logMsgStr"
logger -t "${SCRIPT_NAME}_[$$]" -p $logPriNum "$logMsgStr"
fi
}

Expand Down