bugfix: CPE510: networking does not function after initial config save

After saving the config the lack of the root level switch entry which enables vlans and resets the switch causes the network to shutdown.
This commit is contained in:
Conrad Lara - KG6JEI 2015-04-06 10:44:05 -07:00
parent 3c07872f06
commit 6e74aaf0f4
1 changed files with 16 additions and 0 deletions

View File

@ -12,6 +12,22 @@ boot() {
then
mkdir -p /etc/aredn_include
touch /etc/aredn_include/swconfig
i=0
while true; do
uci -q get network.\@switch\[$i\] > /dev/null
local status=$?
if [ $status == 1 ]
then
break
fi
echo "config switch" >> /etc/aredn_include/swconfig
echo " option name '`uci -q get network.\@switch\[$i\].name`'" >> /etc/aredn_include/swconfig
echo " option reset '`uci -q get network.\@switch\[$i\].reset`'" >> /etc/aredn_include/swconfig
echo " option enable_vlan '`uci -q get network.\@switch\[$i\].enable_vlan`'" >> /etc/aredn_include/swconfig
echo "" >> /etc/aredn_include/swconfig
let i++
done
i=0
while true; do
uci -q get network.\@switch_vlan\[$i\] > /dev/null