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 @@
# uiDivStats - WebUI for Diversion statistics

## v4.0.15
### Updated on 2026-Jan-25
### Updated on 2026-Feb-18

## About
A graphical representation of domain blocking performed by Diversion.
Expand Down
46 changes: 38 additions & 8 deletions uiDivStats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## Forked from https://github.com/jackyaz/uiDivStats ##
## ##
###################################################################
# Last Modified: 2026-Jan-25
# Last Modified: 2026-Feb-18
#------------------------------------------------------------------

################# Shellcheck directives ###############
Expand All @@ -36,7 +36,7 @@
### Start of script variables ###
readonly SCRIPT_NAME="uiDivStats"
readonly SCRIPT_VERSION="v4.0.15"
readonly SCRIPT_VERSTAG="26012522"
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"
Expand Down Expand Up @@ -72,6 +72,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

readonly oneKByte=1024
readonly oneMByte=1048576
readonly oneGByte=1073741824
Expand Down Expand Up @@ -297,9 +300,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 @@ -360,6 +365,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 "$?"
}

Update_File()
{
if [ "$1" = "uidivstats_www.asp" ]
Expand Down Expand Up @@ -2954,7 +2976,8 @@ MainMenu()
;;
u)
printf "\n"
if Check_Lock menu; then
if Check_Lock menu
then
Update_Version
Clear_Lock
fi
Expand All @@ -2963,7 +2986,8 @@ MainMenu()
;;
uf)
printf "\n"
if Check_Lock menu; then
if Check_Lock menu
then
Update_Version force
Clear_Lock
fi
Expand All @@ -2985,7 +3009,8 @@ MainMenu()
exit 0
;;
z)
while true; do
while true
do
printf "\\n${BOLD}Are you sure you want to uninstall %s? (y/n)${CLEARFORMAT} " "$SCRIPT_NAME"
read -r confirm
case "$confirm" in
Expand Down Expand Up @@ -3596,7 +3621,7 @@ then
fi

##----------------------------------------##
## Modified by Martinski W. [2024-Dec-21] ##
## Modified by Martinski W. [2026-Feb-18] ##
##----------------------------------------##
case "$1" in
install)
Expand Down Expand Up @@ -3699,6 +3724,11 @@ case "$1" in
Update_Version force unattended
exit 0
;;
amtmupdate)
shift
ScriptUpdateFromAMTM "$@"
exit "$?"
;;
setversion)
Set_Version_Custom_Settings local "$SCRIPT_VERSION"
Set_Version_Custom_Settings server "$SCRIPT_VERSION"
Expand Down