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: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# YazDHCP

## v1.2.4
## v1.2.5

### Updated on 2025-Nov-20
### Updated on 2026-Feb-18

## About

Expand Down
37 changes: 31 additions & 6 deletions YazDHCP.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## Forked from https://github.com/jackyaz/YazDHCP ##
## ##
##########################################################
# Last Modified: 2025-Nov-20
# Last Modified: 2026-Feb-18
#---------------------------------------------------------

#############################################
Expand All @@ -29,9 +29,9 @@

### Start of script variables ###
readonly SCRIPT_NAME="YazDHCP"
readonly SCRIPT_VERSION="v1.2.4"
readonly SCRIPT_VERSTAG="25112022"
SCRIPT_BRANCH="master"
readonly SCRIPT_VERSION="v1.2.5"
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_CONF="$SCRIPT_DIR/DHCP_clients"
Expand Down Expand Up @@ -74,6 +74,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

# Give higher priority to built-in binaries #
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH"

Expand Down Expand Up @@ -964,6 +967,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-Sep-05] ##
##----------------------------------------##
Expand Down Expand Up @@ -4891,7 +4911,7 @@ else SCRIPT_VERS_INFO="[$versionDev_TAG]"
fi

##----------------------------------------##
## Modified by Martinski W. [2025-Sep-05] ##
## Modified by Martinski W. [2026-Feb-18] ##
##----------------------------------------##
if [ $# -eq 0 ] || [ -z "$1" ]
then
Expand Down Expand Up @@ -5014,11 +5034,16 @@ case "$1" in
Update_Version force unattended
exit 0
;;
amtmupdate)
shift
ScriptUpdateFromAMTM "$@"
exit "$?"
;;
setversion)
Set_Version_Custom_Settings local
Set_Version_Custom_Settings server "$SCRIPT_VERSION"
if [ $# -lt 2 ] || [ -z "$2" ]
then
then
exec "$0"
fi
exit 0
Expand Down