Reduce traffic for configsync and handle more priming quirks
This commit is contained in:
parent
5402e7ce24
commit
4963afa8d6
@ -9,8 +9,10 @@ uci delete 'firewall.lan.network'
|
||||
uci add_list 'firewall.lan.network'=iface_lan
|
||||
|
||||
uci rename 'network.lan'=iface_lan
|
||||
while uci -q delete 'network.@interfaces[1]'; do :; done # Delete any non-standard interfaces
|
||||
|
||||
uci rename 'network.@device[0]'=br_lan
|
||||
while uci -q delete 'network.@device[1]'; do :; done # Delete any non-standard devices
|
||||
|
||||
uci rename 'wireless.radio0'=radio24
|
||||
uci rename 'wireless.default_radio0'=iface_radio24
|
||||
@ -18,4 +20,14 @@ uci rename 'wireless.default_radio0'=iface_radio24
|
||||
uci rename 'wireless.radio1'=radio5
|
||||
uci rename 'wireless.default_radio1'=iface_radio5
|
||||
|
||||
uci get network.@switch[0] && uci rename network.@switch[0]=switch0
|
||||
|
||||
while uci -q delete 'dhcp.@dhcp[0]'; do :; done # Delete any DHCP configuration on initial setup
|
||||
|
||||
# Board-specific quirks
|
||||
BOARD="$(ubus call system board | jsonfilter -e '@.model')"
|
||||
case "$BOARD" in
|
||||
"Bananapi BPI-R3")
|
||||
uci add_list "network.br_lan.ports=wan" # Add wan port which is initially part of wan interface
|
||||
;;
|
||||
esac
|
||||
|
@ -23,8 +23,11 @@ cleanup() {
|
||||
fetch() {
|
||||
local dl=1
|
||||
for endpoint in $(uci get "$CONFIGSAVE".endpoints); do
|
||||
wget -T "$TIMEOUT" "$endpoint/config" -O "$CFGPATH" || continue
|
||||
wget -T "$TIMEOUT" "$endpoint/checksum" -O "$CSUMPATH" || continue
|
||||
local expcsum="$(cat "$CSUMPATH")"
|
||||
[ "$(uci -q get "$CONFIGSAVE".lastbadcsum)" != "$expcsum" ] || break # Avoid re-fetching bad config
|
||||
[ "$(uci -q get "$CONFIGSAVE".currentcsum)" != "$expcsum" ] || break # Avoid re-fetching config if checksum doesn't differ
|
||||
wget -T "$TIMEOUT" "$endpoint/config" -O "$CFGPATH" || continue
|
||||
dl=0
|
||||
break
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user