mirror of https://github.com/aredn/aredn.git
hardware: AR934x: Store swconfig information for future use
This commit is contained in:
parent
a73e459263
commit
dccd1ea42c
|
@ -5,11 +5,46 @@ START=99
|
|||
boot() {
|
||||
|
||||
[ -x /usr/local/bin/bbhn-postupgrade ] && /usr/local/bin/bbhn-postupgrade
|
||||
|
||||
# extract kamikaze generated vlan config
|
||||
#CMLARA Not needed on BULLETM's maybe needed on other devices
|
||||
#[ -f /etc/vlan ] || head -n5 /etc/config/network > /etc/vlan
|
||||
|
||||
|
||||
# extract auto-generated first boot switch config settings
|
||||
# and store them for future use
|
||||
if [ ! -f /etc/aredn_include/swconfig ]
|
||||
then
|
||||
mkdir -p /etc/aredn_include
|
||||
i=0
|
||||
while true; do
|
||||
uci -q get network.\@switch_vlan\[$i\] > /dev/null
|
||||
local status=$?
|
||||
if [ $status == 1 ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
echo "config switch_vlan" >> /etc/aredn_include/swconfig
|
||||
echo " option device '`uci -q get network.\@switch_vlan\[$i\].device`'" >> /etc/aredn_include/swconfig
|
||||
echo " option vlan '`uci -q get network.\@switch_vlan\[$i\].vlan`'" >> /etc/aredn_include/swconfig
|
||||
echo " option ports '`uci -q get network.\@switch_vlan\[$i\].ports`'" >> /etc/aredn_include/swconfig
|
||||
echo "" >> /etc/aredn_include/swconfig
|
||||
let i++
|
||||
done
|
||||
|
||||
i=0
|
||||
while true; do
|
||||
uci -q get network.\@switch_port\[$i\] > /dev/null
|
||||
local status=$?
|
||||
if [ $status == 1 ]
|
||||
then
|
||||
break
|
||||
fi
|
||||
echo "config switch_port" >> /etc/aredn_include/swconfig
|
||||
echo " option device '`uci -q get network.\@switch_port\[$i\].device`'" >> /etc/aredn_include/swconfig
|
||||
echo " option port '`uci -q get network.\@switch_port\[$i\].port`'" >> /etc/aredn_include/swconfig
|
||||
echo " option pvid '`uci -q get network.\@switch_port\[$i\].pvid`'" >> /etc/aredn_include/swconfig
|
||||
echo "" >> /etc/aredn_include/swconfig
|
||||
let i++
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
# setup nvram variables
|
||||
[ -x /usr/local/bin/nvram-setup ] && /usr/local/bin/nvram-setup
|
||||
|
||||
|
|
Loading…
Reference in New Issue