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.2
## v1.2.3

### Updated on 2025-Nov-02
### Updated on 2025-Nov-04

## About

Expand Down
37 changes: 28 additions & 9 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-02
# Last Modified: 2025-Nov-04
#---------------------------------------------------------

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

### Start of script variables ###
readonly SCRIPT_NAME="YazDHCP"
readonly SCRIPT_VERSION="v1.2.2"
readonly SCRIPT_VERSTAG="25110223"
readonly SCRIPT_VERSION="v1.2.3"
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.d"
Expand Down Expand Up @@ -193,7 +193,10 @@ readonly ListIconsOpt="ls"
iconsFound=false
backupsFound=false
waitToConfirm=false
wifiRestarted=false
inStartupMode=false
gnCheckAttemptNum=0
isInteractiveMenuMode=false
maxUserIconsBackupFiles="$defMaxUserIconsBackupFiles"
theUserIconsBackupDir="$defUserIconsBackupDir"
prefUserIconsBackupDir="$theUserIconsBackupDir"
Expand Down Expand Up @@ -1054,6 +1057,7 @@ _CheckForWirelessRadioEnabled_()
done
"$wifiRadioEnabled" && return 0

! "$isInteractiveMenuMode" && \
Print_Output true "Wireless Radios are *NOT* enabled." "$WARN"
return 1
}
Expand All @@ -1072,7 +1076,8 @@ _Get_ActiveGuestNetwork_VirtualInterfaces_()
if ! _CheckForWirelessRadioEnabled_ && \
[ "${#gnInfoStr1}" -eq 0 ] && [ "${#gnInfoStr2}" -eq 0 ]
then
Print_Output true "Guest Network Interfaces *NOT* found." "$ERR"
! "$isInteractiveMenuMode" && \
Print_Output true "Guest Network Interfaces *NOT* found." "$WARN"
return 1
fi

Expand Down Expand Up @@ -4221,13 +4226,18 @@ _Check_ActiveGuestNetwork_SubnetInfo_()
if [ -z "$gnListOfIFaces" ]
then
_Init_ActiveGuestNetwork_SubnetInfo_
if "$inStartupMode"
then ## Try again after initial startup ##
if "$inStartupMode" || "$wifiRestarted"
then ## Try again after some timeout ##
if [ -s /jffs/scripts/YazFi ]
then sleepSecs=45
then sleepSecs=60
elif [ "$fwInstalledBaseVers" -lt 3006 ]
then sleepSecs=30
fi
gnCheckAttemptNum="$((gnCheckAttemptNum + 1))"
if [ "$gnCheckAttemptNum" -ge 2 ]
then inStartupMode=false ; wifiRestarted=false
fi
Print_Output true "Trying again. Check for available Guest Networks in $sleepSecs sec." "$PASS"
( sleep "$sleepSecs" ; _Check_ActiveGuestNetwork_SubnetInfo_ ) &
else
_AllowGuestNetwork_IP_Reservations_ reset false
Expand Down Expand Up @@ -4307,6 +4317,7 @@ MainMenu()
{
local showexport menuOption srMenuOptStr gnMenuOptStr dhcpStaticIPsOK
local allowGuestNetIPaddrReservations gnAllowReservationsMenuSetting
isInteractiveMenuMode=true

_HandleInvalidOption_()
{
Expand Down Expand Up @@ -4800,6 +4811,7 @@ fi
##----------------------------------------##
if [ $# -eq 0 ] || [ -z "$1" ]
then
isInteractiveMenuMode=true
Create_Dirs
Set_Version_Custom_Settings local
Create_Symlinks 2>/dev/null
Expand Down Expand Up @@ -4842,9 +4854,16 @@ case "$1" in
if [ "$2" = "restart" ] && [ "$3" = "wireless" ]
then
NTP_Ready
Print_Output true "Wireless restarted. Checking for available Guest Networks in 20 secs...." "$PASS"
sleepSecs=20
if [ -s /jffs/scripts/YazFi ]
then sleepSecs=60
elif [ "$fwInstalledBaseVers" -lt 3006 ]
then sleepSecs=30
fi
wifiRestarted=true
Print_Output true "Wireless restarted. Check for available Guest Networks in $sleepSecs sec." "$PASS"
Check_Lock
sleep 20
sleep "$sleepSecs"
_Update_GuestNetCheck_Status_ INIT
_Check_ActiveGuestNetwork_SubnetInfo_
Process_DHCP_Clients
Expand Down