3 # Dieses Skript wird nur ein einziges Mal nach einem Upgrade oder der Erstinstallation ausgefuehrt: 4 # http://wiki.openwrt.org/doc/uci#defaults 7 # shellcheck source=opennet/packages/on-core/files/usr/lib/opennet/on-helper.sh 8 .
"${IPKG_INSTROOT:-}/usr/lib/opennet/on-helper.sh" 11 # add channel whitelist for 5GHz devices to /etc/config/wireless 12 # info: the additional option "chanlist" is enabled by one of our patches 13 # TODO: move this adjustment to a future "configure as wifi master" web interface action 14 find_all_uci_sections wireless wifi-device
"hwmode=11a" "channel=auto" |
while read -r device_uci_prefix;
do 15 # do not touch non-empty chanlists 16 [ -n
"$(uci_get "${device_uci_prefix}.chanlist
")" ] &&
continue 17 # the device name could be "radio0" or similar 18 device_name=$(echo
"$device_uci_prefix" | cut -f 2 -
d .)
19 # do not touch devices without a master interface 20 ap_interfaces=$(find_all_uci_sections wireless wifi-iface
"device=$device_name" "mode=ap")
21 [ -z
"$ap_interfaces" ] &&
continue 22 # Use one (random) indoor channel and multiple outdoor channels. This allows a usable
23 # fallback even under bad conditions. 24 indoor_channel=$(( 36 + 4 * $(get_random 4) ))
25 # use all outdoor channels except 128 (used by the local weather station)
26 uci
set "${device_uci_prefix}.chanlist=$indoor_channel 100-124 132-140" 27 uci commit
"$device_uci_prefix" set eu on function print_services services log for dir in etc on services d var on services volatile d