From 8cdbdf113ae13cd7c9886432c3df2fe3f8054cb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 22:22:34 +0000 Subject: [PATCH 1/4] Bump actions/checkout from 6.0.1 to 6.0.2 in the all-actions group Bumps the all-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 6.0.1 to 6.0.2 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6.0.1...v6.0.2) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/Create-NewReleases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Create-NewReleases.yml b/.github/workflows/Create-NewReleases.yml index 25c8ebb..d31121b 100644 --- a/.github/workflows/Create-NewReleases.yml +++ b/.github/workflows/Create-NewReleases.yml @@ -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' From 1f5c4261733881ea36a181d7ca4a92b0b3070fa0 Mon Sep 17 00:00:00 2001 From: Martinski4GitHub <119833648+Martinski4GitHub@users.noreply.github.com> Date: Wed, 18 Feb 2026 00:36:44 -0800 Subject: [PATCH 2/4] New Functionality Initial code to support automatic script updates via AMTM. --- README.md | 4 ++-- YazDHCP.sh | 37 +++++++++++++++++++++++++++++++------ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index cf1abe2..79c2178 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # YazDHCP -## v1.2.4 +## v1.2.5 -### Updated on 2025-Nov-20 +### Updated on 2026-Feb-18 ## About diff --git a/YazDHCP.sh b/YazDHCP.sh index 7aae4af..cd2da0d 100644 --- a/YazDHCP.sh +++ b/YazDHCP.sh @@ -13,7 +13,7 @@ ## Forked from https://github.com/jackyaz/YazDHCP ## ## ## ########################################################## -# Last Modified: 2025-Nov-20 +# Last Modified: 2026-Feb-18 #--------------------------------------------------------- ############################################# @@ -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" @@ -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" @@ -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] ## ##----------------------------------------## @@ -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 @@ -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 From 69d9337dd3d28d863b7a114d1785eafdb4db248d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 21:05:19 +0000 Subject: [PATCH 3/4] Bump softprops/action-gh-release in the all-actions group Bumps the all-actions group with 1 update: [softprops/action-gh-release](https://github.com/softprops/action-gh-release). Updates `softprops/action-gh-release` from 2.5.0 to 2.6.1 - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v2.5.0...v2.6.1) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-version: 2.6.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: all-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/Create-NewReleases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Create-NewReleases.yml b/.github/workflows/Create-NewReleases.yml index d31121b..4e72284 100644 --- a/.github/workflows/Create-NewReleases.yml +++ b/.github/workflows/Create-NewReleases.yml @@ -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 }} From beb172700a24dae4fbc720f05c75f68480d7d801 Mon Sep 17 00:00:00 2001 From: Martinski4GitHub <119833648+Martinski4GitHub@users.noreply.github.com> Date: Sat, 21 Mar 2026 03:10:19 -0700 Subject: [PATCH 4/4] Code Improvements. Miscellaneous code improvements. --- README.md | 2 +- YazDHCP.sh | 29 +++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 79c2178..61f36e0 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## v1.2.5 -### Updated on 2026-Feb-18 +### Updated on 2026-Mar-21 ## About diff --git a/YazDHCP.sh b/YazDHCP.sh index cd2da0d..e5c94eb 100644 --- a/YazDHCP.sh +++ b/YazDHCP.sh @@ -13,7 +13,7 @@ ## Forked from https://github.com/jackyaz/YazDHCP ## ## ## ########################################################## -# Last Modified: 2026-Feb-18 +# Last Modified: 2026-Mar-21 #--------------------------------------------------------- ############################################# @@ -30,7 +30,7 @@ ### Start of script variables ### readonly SCRIPT_NAME="YazDHCP" readonly SCRIPT_VERSION="v1.2.5" -readonly SCRIPT_VERSTAG="26021800" +readonly SCRIPT_VERSTAG="26032100" SCRIPT_BRANCH="develop" SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH" readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME.d" @@ -112,7 +112,6 @@ readonly NVRAM_3004_DHCPvar_RegExp="dhcp_staticlist=[<]?${MACaddr_RegEx}>.+" readonly NVRAM_3006_DHCPvar_RegExp0="dhcpres[1-9][0-9]?_rl=" readonly NVRAM_3006_DHCPvar_RegExp1="${NVRAM_3006_DHCPvar_RegExp0}<${MACaddr_RegEx}>.+" -readonly addnDHCP_HostNames=true readonly guestNetInfoJSfileName="GuestNetworkSubnetInfo.js" readonly guestNetInfoJSfilePath="${SCRIPT_DIR}/$guestNetInfoJSfileName" readonly dhcpGuestNetAllowVarKey="allowGuestNet_IPaddr_Reservations" @@ -3617,7 +3616,7 @@ Update_Hostnames_GuestNet() gnExistingMD5="$(md5sum "$hostNamesFileGNET" | awk '{print $1}')" mv -f "$hostNamesFileGNET" "$hostNamesFileBKUP" fi - printf "" > "$hostNamesFileGNET" + printf '' > "$hostNamesFileGNET" gnIFaceVarStr="GNIFACE_${gnIFaceName}=" gnStartIPaddr4="$(echo "$gnInfoStr" | grep -E "^${gnIFaceVarStr}.*" | cut -d'=' -f2 | cut -d',' -f1)" @@ -3808,7 +3807,7 @@ Update_StaticList_GuestNet() gnExistingMD5="$(md5sum "$staticListFileGNET" | awk '{print $1}')" mv -f "$staticListFileGNET" "$staticListFileBKUP" fi - printf "" > "$staticListFileGNET" + printf '' > "$staticListFileGNET" gnIFaceVarStr="GNIFACE_${gnIFaceName}=" gnStartIPaddr4="$(echo "$gnInfoStr" | grep -E "^${gnIFaceVarStr}.*" | cut -d'=' -f2 | cut -d',' -f1)" @@ -3999,7 +3998,7 @@ Update_OptionsList_GuestNet() gnExistingMD5="$(md5sum "$optionsListFileGNET" | awk '{print $1}')" mv -f "$optionsListFileGNET" "$optionsListFileBKUP" fi - printf "" > "$optionsListFileGNET" + printf '' > "$optionsListFileGNET" gnIFaceVarStr="GNIFACE_${gnIFaceName}=" gnStartIPaddr4="$(echo "$gnInfoStr" | grep -E "^${gnIFaceVarStr}.*" | cut -d'=' -f2 | cut -d',' -f1)" @@ -4104,17 +4103,14 @@ CleanUp_OptionsList_GuestNet() Update_Hostnames() { local lanExistingMD5="" lanUpdatedMD5="" msgTagStr="" - local hostNamesFilePATH="$SCRIPT_DIR/.hostnames" local hostNamesFileBKUP="${hostNamesFilePATH}.BKUP" - ##OFF## ! "$addnDHCP_HostNames" && return 0 ##OFF## - if [ -s "$hostNamesFilePATH" ] then lanExistingMD5="$(md5sum "$hostNamesFilePATH" | awk '{print $1}')" mv -f "$hostNamesFilePATH" "$hostNamesFileBKUP" fi - printf "" > "$hostNamesFilePATH" + printf '' > "$hostNamesFilePATH" Update_Hostnames_MainLAN Update_Hostnames_GuestNet @@ -4150,7 +4146,6 @@ Update_Hostnames() Update_StaticList() { local lanExistingMD5="" lanUpdatedMD5="" msgTagStr="" - local staticListFilePATH="$SCRIPT_DIR/.staticlist" local staticListFileBKUP="${staticListFilePATH}.BKUP" if [ -s "$staticListFilePATH" ] @@ -4158,7 +4153,7 @@ Update_StaticList() lanExistingMD5="$(md5sum "$staticListFilePATH" | awk '{print $1}')" mv -f "$staticListFilePATH" "$staticListFileBKUP" fi - printf "" > "$staticListFilePATH" + printf '' > "$staticListFilePATH" Update_StaticList_MainLAN Update_StaticList_GuestNet @@ -4194,7 +4189,6 @@ Update_StaticList() Update_OptionsList() { local lanExistingMD5="" lanUpdatedMD5="" msgTagStr="" - local optionsListFilePATH="$SCRIPT_DIR/.optionslist" local optionsListFileBKUP="${optionsListFilePATH}.BKUP" if [ -s "$optionsListFilePATH" ] @@ -4202,7 +4196,7 @@ Update_OptionsList() lanExistingMD5="$(md5sum "$optionsListFilePATH" | awk '{print $1}')" mv -f "$optionsListFilePATH" "$optionsListFileBKUP" fi - printf "" > "$optionsListFilePATH" + printf '' > "$optionsListFilePATH" Update_OptionsList_MainLAN Update_OptionsList_GuestNet @@ -4238,6 +4232,10 @@ Update_OptionsList() Process_DHCP_Clients() { local retCode=1 delBkupCopy=true verboseMode + local hostNamesFilePATH="$SCRIPT_DIR/.hostnames" + local staticListFilePATH="$SCRIPT_DIR/.staticlist" + local optionsListFilePATH="$SCRIPT_DIR/.optionslist" + if [ $# -gt 0 ] && { [ "$1" = "true" ] || [ "$1" = "false" ] ; } then RESTART_DNSMASQ="$1" else RESTART_DNSMASQ=false @@ -4246,6 +4244,9 @@ Process_DHCP_Clients() if [ ! -s "$SCRIPT_CONF" ] || \ ! grep -qv "MAC,IP,HOSTNAME,DNS" "$SCRIPT_CONF" then + printf '' > "$hostNamesFilePATH" + printf '' > "$staticListFilePATH" + printf '' > "$optionsListFilePATH" Print_Output true "No DHCP client IP address assignments were found." "$WARN" return 1 fi