Skip to content

Commit 80bd368

Browse files
Exclude AP's from AiMesh Detection
Exclude AP's from AiMesh Detection
1 parent f499920 commit 80bd368

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

MerlinAU.sh

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
#
55
# Original Creation Date: 2023-Oct-01 by @ExtremeFiretop.
66
# Official Co-Author: @Martinski W. - Date: 2023-Nov-01
7-
# Last Modified: 2025-Jun-02
7+
# Last Modified: 2025-Jun-06
88
###################################################################
99
set -u
1010

1111
## Set version for each Production Release ##
12-
readonly SCRIPT_VERSION=1.4.7
12+
readonly SCRIPT_VERSION=1.4.8
1313
readonly SCRIPT_NAME="MerlinAU"
1414
## Set to "master" for Production Releases ##
1515
SCRIPT_BRANCH="master"
@@ -4638,33 +4638,38 @@ _GetLoginCredentials_()
46384638
return 0
46394639
}
46404640

4641-
##----------------------------------------##
4642-
## Modified by Martinski W. [2024-Apr-06] ##
4643-
##----------------------------------------##
4641+
##-------------------------------------------##
4642+
## Modified by ExtremeFiretop [2025-June-06] ##
4643+
##-------------------------------------------##
46444644
_GetNodeIPv4List_()
46454645
{
4646-
# Get the value of asus_device_list #
4647-
local ip_addresses
4648-
local device_list="$(nvram get asus_device_list)"
4646+
local NODE_ROLE="2" # keep only nodes whose last field == 2
4647+
local device_list ip_addresses
46494648

4650-
# Check if asus_device_list is not empty #
4651-
if [ -n "$device_list" ]
4652-
then
4653-
# Split the device list into records and extract the IP addresses, excluding Main Router LAN IP address #
4654-
ip_addresses="$(echo "$device_list" | tr '<' '\n' | awk -v exclude="$mainLAN_IPaddr" -F'>' '{if (NF>=4 && $3 != exclude) print $3}')"
4649+
device_list="$(nvram get asus_device_list)"
46554650

4656-
# Check if IP addresses are not empty #
4657-
if [ -n "$ip_addresses" ]; then
4658-
# Print each IP address on a separate line
4659-
printf "%s\n" "$ip_addresses"
4660-
else
4661-
return 1
4662-
fi
4663-
else
4651+
if [ -z "$device_list" ]; then
46644652
Say "NVRAM asus_device_list is NOT populated. No Mesh Nodes were found."
46654653
return 1
46664654
fi
4667-
return 0
4655+
4656+
ip_addresses="$(
4657+
printf '%s\n' "$device_list" |
4658+
tr '<' '\n' |
4659+
awk -F'>' \
4660+
-v role="$NODE_ROLE" \
4661+
-v exclude="$mainLAN_IPaddr" '
4662+
NF >= 4 && $3 != exclude && $NF == role { print $3 }
4663+
'
4664+
)"
4665+
4666+
if [ -n "$ip_addresses" ]; then
4667+
printf '%s\n' "$ip_addresses"
4668+
return 0
4669+
fi
4670+
4671+
# nothing matched
4672+
return 1
46684673
}
46694674

46704675
##----------------------------------------##

0 commit comments

Comments
 (0)