bugfix: CPE510: Network activity led's broke after config save

Save the port mapping for link_lan led's for use in the system file so that the link led's will work after save and reboot
This commit is contained in:
Conrad Lara - KG6JEI 2015-04-06 21:03:13 -07:00
parent b6805ca15f
commit e7c3cdc909
6 changed files with 32 additions and 0 deletions

View File

@ -15,3 +15,4 @@ config button
option min '12'
option max '20'
include /etc/aredn_include/system_netled

View File

@ -15,3 +15,4 @@ config button
option min '12'
option max '20'
include /etc/aredn_include/system_netled

View File

@ -15,3 +15,4 @@ config button
option min '12'
option max '20'
include /etc/aredn_include/system_netled

View File

@ -15,3 +15,4 @@ config button
option min '12'
option max '20'
include /etc/aredn_include/system_netled

View File

@ -15,3 +15,4 @@ config button
option min '12'
option max '20'
include /etc/aredn_include/system_netled

View File

@ -87,6 +87,33 @@ boot() {
fi
# Save system NET LED settings
if [ ! -f /etc/aredn_include/system_netled]
then
mkdir -p /etc/aredn_include
touch /etc/aredn_include/system_netled
i=0
while true; do
uci -q get system.led_lan$i > /dev/null
local status=$?
if [ $status == 1 ]
then
break
fi
echo "config led 'led_lan$i'" >> /etc/aredn_include/system_netled
echo " option name '`uci -q get system.led_lan$i.name`'" >> /etc/aredn_include/system_netled
echo " option sysfs '`uci -q get system.led_lan$i.sysfs`'" >> /etc/aredn_include/system_netled
echo " option trigger '`uci -q get system.led_lan$i.trigger`'" >> /etc/aredn_include/system_netled
echo " option port_mask '`uci -q get system.led_lan$i.name`'" >> /etc/aredn_include/system_netled
echo "" >> /etc/aredn_include/system_netled
let i++
done
fi
# setup nvram variables
[ -x /usr/local/bin/nvram-setup ] && /usr/local/bin/nvram-setup