obuspa: avoid uci commit in uci-defaults

This commit is contained in:
Vivek Kumar Dutta 2025-03-05 10:22:23 +05:30
parent d9a742b734
commit 892e0f3599
No known key found for this signature in database
GPG key ID: 4E09F5AD8265FD4C

View file

@ -38,13 +38,11 @@ configure_dhcp_options() {
if [ "${role}" = "extender" ]; then if [ "${role}" = "extender" ]; then
interface="lan" interface="lan"
uci -q set obuspa.global.interface="lan" uci -q set obuspa.global.interface="lan"
uci commit obuspa
else else
interface="wan" interface="wan"
fi fi
fi fi
network_uci_update=0
reqopts="$(uci -q get network."${interface}".reqopts)" reqopts="$(uci -q get network."${interface}".reqopts)"
proto="$(uci -q get network."${interface}".proto)" proto="$(uci -q get network."${interface}".proto)"
local req125_present=0 local req125_present=0
@ -70,19 +68,13 @@ configure_dhcp_options() {
if [ ${req125_present} -eq 0 ]; then if [ ${req125_present} -eq 0 ]; then
newreqopts="$reqopts 125" newreqopts="$reqopts 125"
uci -q set network."${interface}".reqopts="$newreqopts" uci -q set network."${interface}".reqopts="$newreqopts"
network_uci_update=1
fi fi
if [ ${send124_present} -eq 0 ]; then if [ ${send124_present} -eq 0 ]; then
newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70" newsendopts="${sendopts} 124:00:00:0D:E9:04:03:75:73:70"
uci -q set network."${interface}".sendopts="$newsendopts" uci -q set network."${interface}".sendopts="$newsendopts"
network_uci_update=1
fi fi
fi fi
if [ ${network_uci_update} -eq 1 ]; then
uci commit network
fi
} }
configure_dhcp_options configure_dhcp_options