From 7d596ee470b191d7bca65f3241f2e4fd0060d11b Mon Sep 17 00:00:00 2001 From: Ryan Hamel Date: Sun, 14 Jan 2024 12:48:48 -0800 Subject: [PATCH 1/2] Add Wi-Fi 6 BSS Coloring to udhcpc.user --- openwrt/files/etc/udhcpc.user | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/openwrt/files/etc/udhcpc.user b/openwrt/files/etc/udhcpc.user index ce3b7424..98ae1f33 100644 --- a/openwrt/files/etc/udhcpc.user +++ b/openwrt/files/etc/udhcpc.user @@ -5,6 +5,20 @@ case "$1" in "renew"|"bound") # dump params to tmp so its easier to troubleshoot set > /tmp/dhcp.params + + board = `cat /etc/board.json | jq '.model.id' -r | cut -d',' -f2` + + if [ $1 == "bound" ] && [ $board == "e8450-ubi" ] ; then + bss_color = `echo $ip | cut -d'.' -f4 | expr \( $i % 62 \) + 1` + uci_bss_color = `uci -q show wireless.radio1.he_bss_color` + + if [ $bss_color != $uci_bss_color ] || [ $? == 0 ]; then + uci set 'wireless.radio1.he_bss_color'=$bss_color + uci commit + wifi reload + fi + fi + radio0=`uci show 'wireless.radio0.channel'|cut -f 2 -d "'"` radio1=`uci show 'wireless.radio1.channel'|cut -f 2 -d "'"` if [ ! -z "$opt224" ] || [ ! -z "$opt225" ]; then From 52f89599f4df89896eeebfeb65a3d1730906cb89 Mon Sep 17 00:00:00 2001 From: Ryan Hamel Date: Sun, 14 Jan 2024 12:53:49 -0800 Subject: [PATCH 2/2] Exit Codes..how do they work --- openwrt/files/etc/udhcpc.user | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openwrt/files/etc/udhcpc.user b/openwrt/files/etc/udhcpc.user index 98ae1f33..812db4f7 100644 --- a/openwrt/files/etc/udhcpc.user +++ b/openwrt/files/etc/udhcpc.user @@ -12,7 +12,7 @@ case "$1" in bss_color = `echo $ip | cut -d'.' -f4 | expr \( $i % 62 \) + 1` uci_bss_color = `uci -q show wireless.radio1.he_bss_color` - if [ $bss_color != $uci_bss_color ] || [ $? == 0 ]; then + if [ $bss_color != $uci_bss_color ] || [ $? == 1 ]; then uci set 'wireless.radio1.he_bss_color'=$bss_color uci commit wifi reload