Skip to content

Commit 5b59a26

Browse files
Merge pull request #70 from Martinski4GitHub/develop
Support for New AMTM Functionality
2 parents bc832a8 + 0602454 commit 5b59a26

2 files changed

Lines changed: 33 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# scMerlin
22

33
## v2.5.48
4-
### Updated on 2025-Dec-15
4+
### Updated on 2026-Feb-18
55

66
## About
77
scMerlin allows you to easily control the most common services/scripts on your router. scMerlin also augments your router's WebUI with a Sitemap and dynamic submenus for the main left menu of Asuswrt-Merlin.

scmerlin.sh

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
## Forked from: https://github.com/jackyaz/scMerlin ##
1313
## ##
1414
######################################################
15-
# Last Modified: 2025-Dec-15
15+
# Last Modified: 2026-Feb-18
1616
#-----------------------------------------------------
1717

1818
########## Shellcheck directives ###########
@@ -34,7 +34,7 @@ readonly SCRIPT_NAME="scMerlin"
3434
readonly SCRIPT_NAME_LOWER="$(echo "$SCRIPT_NAME" | tr 'A-Z' 'a-z' | sed 's/d//')"
3535
readonly SCM_VERSION="v2.5.48"
3636
readonly SCRIPT_VERSION="v2.5.48"
37-
readonly SCRIPT_VERSTAG="25121520"
37+
readonly SCRIPT_VERSTAG="26021800"
3838
SCRIPT_BRANCH="develop"
3939
SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH"
4040
readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME_LOWER.d"
@@ -102,6 +102,9 @@ readonly branchxStr_TAG="[Branch: $SCRIPT_BRANCH]"
102102
readonly versionDev_TAG="${SCRIPT_VERSION}_${SCRIPT_VERSTAG}"
103103
readonly versionMod_TAG="$SCRIPT_VERSION on $ROUTER_MODEL"
104104

105+
# To support automatic script updates from AMTM #
106+
doScriptUpdateFromAMTM=true
107+
105108
##-------------------------------------##
106109
## Added by Martinski W. [2025-May-17] ##
107110
##-------------------------------------##
@@ -1167,9 +1170,11 @@ Update_Version()
11671170
localver="$(echo "$updatecheckresult" | cut -f2 -d',')"
11681171
serverver="$(echo "$updatecheckresult" | cut -f3 -d',')"
11691172

1170-
if [ "$isupdate" = "version" ]; then
1173+
if [ "$isupdate" = "version" ]
1174+
then
11711175
Print_Output true "New version of $SCRIPT_NAME available - $serverver" "$PASS"
1172-
elif [ "$isupdate" = "md5" ]; then
1176+
elif [ "$isupdate" = "md5" ]
1177+
then
11731178
Print_Output true "MD5 hash of $SCRIPT_NAME does not match - hotfix available - $serverver" "$PASS"
11741179
fi
11751180

@@ -1246,6 +1251,23 @@ Update_Version()
12461251
fi
12471252
}
12481253

1254+
##-------------------------------------##
1255+
## Added by Martinski W. [2026-Feb-18] ##
1256+
##-------------------------------------##
1257+
ScriptUpdateFromAMTM()
1258+
{
1259+
if ! "$doScriptUpdateFromAMTM"
1260+
then
1261+
printf "Automatic script updates via AMTM are currently disabled.\n\n"
1262+
return 1
1263+
fi
1264+
if [ $# -gt 0 ] && [ "$1" = "check" ]
1265+
then return 0
1266+
fi
1267+
Update_Version force unattended
1268+
return "$?"
1269+
}
1270+
12491271
##----------------------------------------##
12501272
## Modified by Martinski W. [2025-Feb-11] ##
12511273
##----------------------------------------##
@@ -3950,7 +3972,7 @@ then
39503972
fi
39513973

39523974
##----------------------------------------##
3953-
## Modified by Martinski W. [2025-Oct-19] ##
3975+
## Modified by Martinski W. [2026-Feb-18] ##
39543976
##----------------------------------------##
39553977
case "$1" in
39563978
install)
@@ -4225,6 +4247,11 @@ case "$1" in
42254247
Update_Version force
42264248
exit 0
42274249
;;
4250+
amtmupdate)
4251+
shift
4252+
ScriptUpdateFromAMTM "$@"
4253+
exit "$?"
4254+
;;
42284255
postupdate)
42294256
Create_Dirs
42304257
Create_Symlinks

0 commit comments

Comments
 (0)