X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=contrib%2Fpackage%2Fmeshwizard%2Ffiles%2Fusr%2Fbin%2Fmeshwizard%2Fhelpers%2Fread_defaults.sh;h=4e0b419c128c2f11ef1067a3c445e7c48d66c3de;hp=67469e3c2ceaf8087a52b0ce4b117c1cc9b1a3b7;hb=05c04b22fa30355ad7e74fba4c10f1f820dcb320;hpb=2fa0fa18150c100b0ed9080444286d1793b287df diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh index 67469e3c2c..4e0b419c12 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh @@ -2,24 +2,34 @@ # This reads the settings we need to have to configure everything # Argument $1: community +. /lib/functions.sh community="$1" # reads variables from uci files, parameter $1 is the section get_var() { - uci -q show $1 | cut -d "." -f 2-100 |grep "\." | sed -e 's/^\([a-z_]*\)\./\1_/g' -e 's/=\(.*\)$/="\1"/g' + uci -q show $1 | cut -d "." -f 2-100 |grep "\." | sed -e 's/^\([A-Za-z0-9_]*\)\./\1_/g' -e 's/=\(.*\)$/="\1"/g' } +handle_widgets() { + widgets="$1 $widgets" +} +config_load freifunk +config_foreach handle_widgets widget +config_load profile_$community +config_foreach handle_widgets widget +echo "widgets=$widgets" + # read default values from /etc/config/freifunk -for v in system wifi_device wifi_iface interface alias dhcp olsr_interface olsr_interfacedefaults zone_freifunk include; do +for v in system wifi_device wifi_iface interface alias dhcp olsr_interface olsr_interfacedefaults zone_freifunk include $widgets; do get_var freifunk.$v done # now read all values from the selected community profile, will override some values from the defaults before -for v in system wifi_device wifi_iface interface alias dhcp olsr_interface olsr_interfacedefaults profile zone_freifunk include; do +for v in system wifi_device wifi_iface interface alias dhcp olsr_interface olsr_interfacedefaults profile zone_freifunk include luci_splash ipv6 $widgets; do get_var profile_$community.$v done # read values from meshwizard -for v in system luci_main contact community; do +for v in system luci_main contact community wan lan general ipv6; do get_var meshwizard.$v done