Merge pull request #389 from hnyman/timezone2015d
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 10 Jun 2015 08:19:19 +0000 (10:19 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 10 Jun 2015 08:19:19 +0000 (10:19 +0200)
Timezone information is updated to 2015d, released on 24 Apr 2015.

54 files changed:
applications/luci-app-ddns/Makefile
applications/luci-app-ddns/luasrc/tools/ddns.lua
applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd
applications/luci-app-olsr/luasrc/controller/olsr.lua
applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm
applications/luci-app-privoxy/Makefile
applications/luci-app-privoxy/luasrc/controller/privoxy.lua [changed mode: 0755->0644]
applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua [changed mode: 0755->0644]
applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm [changed mode: 0755->0644]
applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua
applications/luci-app-radicale/Makefile
applications/luci-app-radicale/luasrc/controller/radicale.lua [changed mode: 0755->0644]
applications/luci-app-radicale/luasrc/model/cbi/radicale.lua [changed mode: 0755->0644]
applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh
contrib/package/community-profiles/files/etc/config/profile_augsburg
contrib/package/community-profiles/files/etc/config/profile_reihen
contrib/package/meshwizard/Makefile
contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/restore_default_config.sh [deleted file]
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh
contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh
modules/luci-base/luasrc/cbi.lua
modules/luci-base/luasrc/view/cbi/error.htm [new file with mode: 0644]
modules/luci-base/po/ca/base.po
modules/luci-base/po/cs/base.po
modules/luci-base/po/de/base.po
modules/luci-base/po/el/base.po
modules/luci-base/po/en/base.po
modules/luci-base/po/es/base.po
modules/luci-base/po/fr/base.po
modules/luci-base/po/he/base.po
modules/luci-base/po/hu/base.po
modules/luci-base/po/it/base.po
modules/luci-base/po/ja/base.po
modules/luci-base/po/ms/base.po
modules/luci-base/po/no/base.po
modules/luci-base/po/pl/base.po
modules/luci-base/po/pt-br/base.po
modules/luci-base/po/pt/base.po
modules/luci-base/po/ro/base.po
modules/luci-base/po/ru/base.po
modules/luci-base/po/sk/base.po
modules/luci-base/po/sv/base.po
modules/luci-base/po/tr/base.po
modules/luci-base/po/uk/base.po
modules/luci-base/po/vi/base.po
modules/luci-base/po/zh-cn/base.po
modules/luci-base/po/zh-tw/base.po
modules/luci-base/root/lib/uci/upload/.gitignore [deleted file]
modules/luci-base/root/lib/uci/upload/.placeholder [new file with mode: 0644]
modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua

index a2d2ae9..0e1e5df 100644 (file)
@@ -10,7 +10,7 @@ PKG_NAME:=luci-app-ddns
 
 # Version == major.minor.patch
 # increase on new functionality (minor) or patches (patch)
-PKG_VERSION:=2.2.3
+PKG_VERSION:=2.2.4
 
 # Release == build
 # increase on changes of translation files
index 6d53931..4466063 100644 (file)
@@ -98,8 +98,7 @@ end
 
 -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>"
 function ipkg_ver_compare(ver1, comp, ver2)
-       if not ver1 or not (#ver1 > 0)
-       or not ver2 or not (#ver2 > 0)
+       if not ver1 or not ver2
        or not comp or not (#comp > 0) then return nil end
        -- correct compare string
        if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~="
@@ -116,33 +115,19 @@ function ipkg_ver_compare(ver1, comp, ver2)
        for i = 1, math.max(table.getn(av1),table.getn(av2)), 1  do
                local s1 = av1[i] or ""
                local s2 = av2[i] or ""
-               local n1 = tonumber(s1)
-               local n2 = tonumber(s2)
 
-               -- one numeric and other empty string then set other to 0
-               if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end
-               if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end
-
-               local nc = (n1 and n2)  -- numeric compare
-
-               if nc then
-                       -- first "not equal" found return true
-                       if comp == "~=" and (n1 ~= n2) then return true end
-                       -- first "lower" found return true
-                       if (comp == "<" or comp == "<=") and (n1 < n2) then return true end
-                       -- first "greater" found return true
-                       if (comp == ">" or comp == ">=") and (n1 > n2) then return true end
-                       -- not equal then return false
-                       if (n1 ~= n2) then return false end
-               else
-                       if comp == "~=" and (s1 ~= s2) then return true end
-                       if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
-                       if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
-                       if (s1 ~= s2) then return false end
-               end
+               -- first "not equal" found return true
+               if comp == "~=" and (s1 ~= s2) then return true end
+               -- first "lower" found return true
+               if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
+               -- first "greater" found return true
+               if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
+               -- not equal then return false
+               if (s1 ~= s2) then return false end
        end
-       -- all equal then true
-       return true
+
+       -- all equal and not compare greater or lower then true
+       return not (comp == "<" or comp == ">")
 end
 
 -- read version information for given package if installed
index a7c433f..689bedc 100644 (file)
@@ -8,12 +8,10 @@ uci batch <<EOF
        commit ucitrack
 EOF
 
-if [ -f /usr/bin/fwknop ]; then
-       uci set fwknopd.@access[0].keytype='Base 64 key'
-       uci set fwknopd.@access[0].hkeytype='Base 64 key'
-       uci set fwknopd.@access[0].KEY_BASE64=`fwknop --key-gen | awk '/^KEY/ {print $2;}'`
-       uci set fwknopd.@access[0].HMAC_KEY_BASE64=`fwknop --key-gen | awk '/^HMAC/ {print $2;}'`
-       uci commit fwknopd
-fi
+uci set fwknopd.@access[0].keytype='Base 64 key'
+uci set fwknopd.@access[0].hkeytype='Base 64 key'
+uci set fwknopd.@access[0].KEY_BASE64=`fwknopd --key-gen | awk '/^KEY/ {print $2;}'`
+uci set fwknopd.@access[0].HMAC_KEY_BASE64=`fwknopd --key-gen | awk '/^HMAC/ {print $2;}'`
+uci commit fwknopd
 rm -f /tmp/luci-indexcache
 exit 0
index 74deb71..cfadd9b 100644 (file)
@@ -80,12 +80,15 @@ end
 function action_json()
        local http = require "luci.http"
        local utl = require "luci.util"
-       local uci = require "luci.model.uci".cursor_state()
+       local uci = require "luci.model.uci".cursor()
        local jsonreq4
        local jsonreq6
 
-       jsonreq4 = utl.exec("echo /status | nc 127.0.0.1 9090")
-       jsonreq6 = utl.exec("echo /status | nc ::1 9090")
+       local v4_port = uci:get("olsrd", "olsrd_jsoninfo", "port") or 9090
+       local v6_port = uci:get("olsrd6", "olsrd_jsoninfo", "port") or 9090
+
+       jsonreq4 = utl.exec("(echo /status | nc 127.0.0.1 " .. v4_port .. ") 2>/dev/null" )
+       jsonreq6 = utl.exec("(echo /status | nc ::1 " .. v6_port .. ") 2>/dev/null")
        http.prepare_content("application/json")
        if not jsonreq4 or jsonreq4 == "" then
                jsonreq4 = "{}"
@@ -368,8 +371,11 @@ function fetch_jsoninfo(otable)
        local IpVersion = uci:get_first("olsrd", "olsrd","IpVersion")
        local jsonreq4 = ""
        local jsonreq6 = ""
-       jsonreq4 = utl.exec("echo /" .. otable .. " | nc 127.0.0.1 9090")
-       jsonreq6 = utl.exec("echo /" .. otable .. " | nc ::1 9090")
+       local v4_port = uci:get("olsrd", "olsrd_jsoninfo", "port") or 9090
+       local v6_port = uci:get("olsrd6", "olsrd_jsoninfo", "port") or 9090
+
+       jsonreq4 = utl.exec("(echo /" .. otable .. " | nc 127.0.0.1 " .. v4_port .. ") 2>/dev/null")
+       jsonreq6 = utl.exec("(echo /" .. otable .. " | nc ::1 " .. v6_port .. ") 2>/dev/null")
        local jsondata4 = {}
        local jsondata6 = {}
        local data4 = {}
index 0a81d17..fa32315 100644 (file)
@@ -6,7 +6,9 @@
 -%>
 
 <%
-local ipv = luci.model.uci.cursor():get_first("olsrd", "olsrd", "IpVersion", "4")
+
+has_ipv4_conf = luci.model.uci.cursor():get_first("olsrd", "olsrd", "IpVersion")
+has_ipv6_conf = luci.model.uci.cursor():get_first("olsrd6", "olsrd", "IpVersion")
 
 function write_conf(conf, file)
        local fs = require "nixio.fs"
@@ -19,23 +21,23 @@ end
 
 conf = luci.http.formvalue()
 
-if conf.openwrt then
+if conf.openwrt_v4 then
        write_conf("/etc/config/olsrd", "olsrd")
        return false
 end
 
-if conf.conf_v4 then   
-       write_conf("/var/etc/olsrd.conf.ipv4", "olsrd.conf.ipv4")
+if conf.openwrt_v6 then
+       write_conf("/etc/config/olsrd6", "olsrd6")
        return false
 end
 
-if conf.conf_v6 then
-       write_conf("/var/etc/olsrd.conf.ipv6", "olsrd.conf.ipv6")
+if conf.conf_v4 then
+       write_conf("/var/etc/olsrd.conf", "olsrd.conf")
        return false
 end
 
-if conf.conf then
-       write_conf("/var/etc/olsrd.conf", "olsrd.conf")
+if conf.conf_v6 then
+       write_conf("/var/etc/olsrd6.conf", "olsrd6.conf")
        return false
 end
 
@@ -200,13 +202,18 @@ XHR.poll(10, '<%=REQUEST_URI%>/json', { },
                        <span id="version">-<span>
                </td></tr>
                 <tr><td width="33%"><%:Download Config%></td><td>
-                               <a href="<%=REQUEST_URI%>?openwrt">OpenWrt</a>,
-                               <% if ipv == "6and4" then %>
-                                       <a href="<%=REQUEST_URI%>?conf_v4">OLSRD IPv4</a>,
-                                       <a href="<%=REQUEST_URI%>?conf_v6">OLSRD IPv6</a>
-                               <% else %>
-                                       <a href="<%=REQUEST_URI%>?conf">OLSRD</a>
-                               <% end %>
+                       <% if has_ipv4_conf then %>
+                           <a href="<%=REQUEST_URI%>?openwrt_v4">OpenWrt (IPv4)</a>,
+                       <% end %>
+                       <% if has_ipv6_conf then %>
+                           <a href="<%=REQUEST_URI%>?openwrt_v6">OpenWrt (IPv6)</a>,
+                       <% end %>
+                       <% if has_ipv4_conf then %>
+                           <a href="<%=REQUEST_URI%>?conf_v4">OLSRD (IPv4)</a>,
+                       <% end %>
+                       <% if has_ipv6_conf then %>
+                           <a href="<%=REQUEST_URI%>?conf_v6">OLSRD (IPv6)</a>
+                       <% end %>
                </td></tr>
        </table>
 </fieldset>
index bc2c57e..3d87a41 100644 (file)
@@ -10,7 +10,7 @@ PKG_NAME:=luci-app-privoxy
 
 # Version == major.minor.patch
 # increase "minor" on new functionality and "patch" on patches/optimization
-PKG_VERSION:=1.0.3
+PKG_VERSION:=1.0.4
 
 # Release == build
 # increase on changes of translation files
old mode 100755 (executable)
new mode 100644 (file)
index 9ffc404..58ba807
@@ -72,8 +72,7 @@ end
 
 -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>"
 function ipkg_ver_compare(ver1, comp, ver2)
-       if not ver1 or not (#ver1 > 0)
-       or not ver2 or not (#ver2 > 0)
+       if not ver1 or not ver2
        or not comp or not (#comp > 0) then return nil end
        -- correct compare string
        if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~="
@@ -90,33 +89,19 @@ function ipkg_ver_compare(ver1, comp, ver2)
        for i = 1, math.max(table.getn(av1),table.getn(av2)), 1  do
                local s1 = av1[i] or ""
                local s2 = av2[i] or ""
-               local n1 = tonumber(s1)
-               local n2 = tonumber(s2)
-
-               -- one numeric and other empty string then set other to 0
-               if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end
-               if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end
-
-               local nc = (n1 and n2)  -- numeric compare
-
-               if nc then
-                       -- first "not equal" found return true
-                       if comp == "~=" and (n1 ~= n2) then return true end
-                       -- first "lower" found return true
-                       if (comp == "<" or comp == "<=") and (n1 < n2) then return true end
-                       -- first "greater" found return true
-                       if (comp == ">" or comp == ">=") and (n1 > n2) then return true end
-                       -- not equal then return false
-                       if (n1 ~= n2) then return false end
-               else
-                       if comp == "~=" and (s1 ~= s2) then return true end
-                       if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
-                       if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
-                       if (s1 ~= s2) then return false end
-               end
+
+               -- first "not equal" found return true
+               if comp == "~=" and (s1 ~= s2) then return true end
+               -- first "lower" found return true
+               if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
+               -- first "greater" found return true
+               if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
+               -- not equal then return false
+               if (s1 ~= s2) then return false end
        end
-       -- all equal then true
-       return true
+
+       -- all equal and not compare greater or lower then true
+       return not (comp == "<" or comp == ">")
 end
 
 -- read version information for given package if installed
old mode 100755 (executable)
new mode 100644 (file)
index c009313..c415f8e
@@ -39,6 +39,7 @@ if not nixio.fs.access("/etc/config/privoxy") or not VEROK then
        local f = SimpleForm("_no_config")
        f.title = TITLE
        f.description = DESC
+       f.embedded = true
        f.submit = false
        f.reset  = false
 
index 99a884f..a8ea57e 100644 (file)
@@ -53,25 +53,6 @@ dsth.rmempty = true
 dsth:value("", translate("all"))
 wa.cbi_add_knownips(dsth)
 
-l7 = s:option(ListValue, "layer7", translate("Service"))
-l7.rmempty = true
-l7:value("", translate("all"))
-
-local pats = io.popen("find /etc/l7-protocols/ -type f -name '*.pat'")
-if pats then
-       local l
-       while true do
-               l = pats:read("*l")
-               if not l then break end
-
-               l = l:match("([^/]+)%.pat$")
-               if l then
-                       l7:value(l)
-               end
-       end
-       pats:close()
-end
-
 p = s:option(Value, "proto", translate("Protocol"))
 p:value("", translate("all"))
 p:value("tcp", "TCP")
index 07998ae..960618d 100644 (file)
@@ -10,7 +10,7 @@ PKG_NAME:=luci-app-radicale
 
 # Version == major.minor.patch
 # increase "minor" on new functionality and "patch" on patches/optimization
-PKG_VERSION:=1.0.0
+PKG_VERSION:=1.0.1
 
 # Release == build
 # increase on changes of translation files
old mode 100755 (executable)
new mode 100644 (file)
index 662c60d..d384b00
@@ -122,8 +122,7 @@ end
 
 -- compare versions using "<=" "<" ">" ">=" "=" "<<" ">>"
 function ipkg_ver_compare(ver1, comp, ver2)
-       if not ver1 or not (#ver1 > 0)
-       or not ver2 or not (#ver2 > 0)
+       if not ver1 or not ver2
        or not comp or not (#comp > 0) then return nil end
        -- correct compare string
        if comp == "<>" or comp == "><" or comp == "!=" or comp == "~=" then comp = "~="
@@ -140,33 +139,19 @@ function ipkg_ver_compare(ver1, comp, ver2)
        for i = 1, math.max(table.getn(av1),table.getn(av2)), 1  do
                local s1 = av1[i] or ""
                local s2 = av2[i] or ""
-               local n1 = tonumber(s1)
-               local n2 = tonumber(s2)
-
-               -- one numeric and other empty string then set other to 0
-               if n1 and not n2 and (not s2 or #s2 == 0) then n2 = 0 end
-               if n2 and not n1 and (not s1 or #s1 == 0) then n1 = 0 end
-
-               local nc = (n1 and n2)  -- numeric compare
-
-               if nc then
-                       -- first "not equal" found return true
-                       if comp == "~=" and (n1 ~= n2) then return true end
-                       -- first "lower" found return true
-                       if (comp == "<" or comp == "<=") and (n1 < n2) then return true end
-                       -- first "greater" found return true
-                       if (comp == ">" or comp == ">=") and (n1 > n2) then return true end
-                       -- not equal then return false
-                       if (n1 ~= n2) then return false end
-               else
-                       if comp == "~=" and (s1 ~= s2) then return true end
-                       if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
-                       if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
-                       if (s1 ~= s2) then return false end
-               end
+
+               -- first "not equal" found return true
+               if comp == "~=" and (s1 ~= s2) then return true end
+               -- first "lower" found return true
+               if (comp == "<" or comp == "<=") and (s1 < s2) then return true end
+               -- first "greater" found return true
+               if (comp == ">" or comp == ">=") and (s1 > s2) then return true end
+               -- not equal then return false
+               if (s1 ~= s2) then return false end
        end
-       -- all equal then true
-       return true
+
+       -- all equal and not compare greater or lower then true
+       return not (comp == "<" or comp == ">")
 end
 
 -- read version information for given package if installed
index 76f6d4d..da8370d 100755 (executable)
@@ -1,13 +1,11 @@
 #!/bin/sh
 
 $(uci -q get luci_splash.general.redirect_url) || {
-       set -x
        touch /var/state/luci_splash_locations
        touch /etc/config/luci_splash_locations
        MAC=$(grep "$REMOTE_HOST" /proc/net/arp | awk '{print $4}')
        uci -P /var/state set luci_splash_locations.${MAC//:/}=redirect
        uci -P /var/state set luci_splash_locations.${MAC//:/}.location="http://${HTTP_HOST}${REQUEST_URI}"
-       set +x
 }
 
 echo -en "Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r\n"
index 4434b0f..4ab82cf 100644 (file)
@@ -22,8 +22,9 @@ config 'defaults' 'bssidscheme'
        option '1'      '02:CA:FF:EE:BA:BE'
 
 config 'defaults' 'luci_splash'
-       option 'limit_up' '20'
-       option 'limit_down' '50'
+       option 'limit_up' '40'
+       option 'limit_down' '120'
+       option 'leasetime' '8'
 
 config widget 'customindex'
        option enabled '1'
index e978d37..a05d6a2 100644 (file)
@@ -17,4 +17,9 @@ config 'defaults' 'wifi_device'
        option 'bssid' '02:07:04:08:08:09'
 
 config 'defaults' 'bssidscheme'
-       option '13'      '02:07:04:08:08:09'
+       option '13'     '02:07:04:08:08:09'
+       option '36'     '02:36:CA:FF:EE:EE'
+
+config 'defaults' 'ssidscheme'
+       option '13'     'ch13.freifunk.net'
+       option '36'     'ch36.freifunk.net'
index 9d74fe5..6959c54 100644 (file)
@@ -4,7 +4,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=meshwizard
-PKG_RELEASE:=0.1.1
+PKG_RELEASE:=0.3.0
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index 8abdf9f..8ace218 100644 (file)
@@ -12,6 +12,21 @@ uci_remove_list_element() {
        done
 }
 
+# string_contains(string, substring)
+#
+# Returns 0 if the specified string contains the specified substring,
+# otherwise returns 1.
+string_contains() {
+    string="$1"
+    substring="$2"
+    if test "${string#*$substring}" != "$string"
+    then
+        return 0    # $substring is in $string
+    else
+        return 1    # $substring is not in $string
+    fi
+}
+
 # Takes 2 arguments
 # $1 = text to be displayed in the output for this section
 # $2 = section (optional)
@@ -29,11 +44,18 @@ set_defaults() {
                a="$(echo $option |cut -d '=' -f1)"
                b="$(echo $option |cut -d '=' -f2-)"
                b="${b//_/ }"
-               uci set $2.$a="$b"
+               string_contains "$a" "_LENGTH" && return
+               string_contains "$a" "_ITEM" && {
+                   # special threatment for lists. use add_list and remove the
+                   # item index (_ITEMx).
+                   uci add_list $2.${a//_ITEM[0-9]*/}="$b"
+               } || {
+                   uci set $2.$a="$b"
+               }
        done
 }
 
-# 3 arguements: 1=config name 2=oldname 3=newname
+# 3 arguments: 1=config name 2=oldname 3=newname
 section_rename() {
        uci -q rename $1.$2=$3 && msg_rename $1.$2 $1.$3 || msg_rename_error $1.$2 $1.$3
 }
@@ -57,3 +79,40 @@ msg_rename() {
 msg_rename_error() {
        echo "    \033[1mWarning:\033[0m Could not rename $1 to $2."
 }
+
+
+restore_factory_defaults() {
+    echo "+ Restore default config as requested with cleanup=1"
+    cp -f /rom/etc/config/* /etc/config/
+    rm /etc/config/wireless
+    wifi detect > /etc/config/wireless
+    rm /etc/config/network
+    if [ -f /etc/init.d/defconfig ]; then
+        # legacy (AA)
+        /etc/init.d/defconfig start
+       [ -f /rom/etc/uci-defaults/network ] && sh /rom/etc/uci-defaults/network
+    else
+        sh /rom/etc/uci-defaults/02_network
+    fi
+}
+
+is_in_list() {
+    # checks if an item is in a list
+    local list="$1"
+    local item="$2"
+    for word in $list; do
+       [ $word = "$item" ] && return 0
+    done
+    return 1
+}
+
+add_to_list() {
+    local list="$1"
+    local item="$2"
+    is_in_list "$list" "$item" && echo $list
+    if [ -z "$list" ]; then
+       echo "$item"
+    else
+       echo "$list $item"
+    fi
+}
index cb0d319..b6ffb62 100755 (executable)
@@ -1,35 +1,61 @@
 #!/bin/sh
-# This reads the settings we need to have to configure everything
-# Argument $1: community
+# These functions read the settings we need for configuration of the router
 
-. /lib/functions.sh
-community="$1"
+read_defaults() {
+       # read default values from the 3 relevant config files and export them
+       # into the environment. Later loaded configs overwrite earlier ones. The
+       # The ordering here is from most generic to most specific:
+       # freifunk (most generic defaults)
+       # profile_* (community defaults)
+       # nodes custom config from meshwizard config file
 
-# 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-Za-z0-9_]*\)\./\1_/g' -e 's/=\(.*\)$/="\1"/g'
-}
-
-handle_widgets() {
-        widgets="$widgets $1"
-}
-config_load freifunk
-config_foreach handle_widgets widget
-config_load profile_$community
-config_foreach handle_widgets widget
-echo "widgets=$widgets"
+       local community="$1"
 
-# 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 $widgets; do
-       get_var freifunk.$v
-done
+       config_cb() {
+       local type="$1"
+       local name="$2"
+       local allowed_section_types="widget"
+       local allowed_section_names="
+               system
+               wifi_device
+               wifi_iface
+               interface
+               alias
+               dhcp
+               olsr_interface
+               olsr_interfacedefaults
+               profile
+               zone_freifunk
+               include
+               luci_splash
+               ipv6
+               luci_main
+               contact
+               community
+               wan
+               lan
+               general
+               ipv6
+               qos
+       "
 
-# 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 luci_splash ipv6 $widgets; do
-       get_var profile_$community.$v
-done
+       if [ "$type" = "widget" ]; then
+               widgets=$(add_to_list "$widgets" "$name")
+       fi
 
-# read values from meshwizard
-for v in system luci_main contact community wan lan general ipv6 qos; do
-        get_var meshwizard.$v
-done
+       if ([ -n "$name" ] && is_in_list "$allowed_section_names" $name) \
+               || is_in_list "$allowed_section_types" $type ; then
+               option_cb() {
+               local option="$1"
+               local value="$2"
+               export "${CONFIG_SECTION}_${option}"="$value"
+               }
+       else
+               option_cb() { return; }
+       fi
+       }
+       config_load freifunk
+       config_load profile_${community}
+       config_load meshwizard
+       export widgets="$widgets"
+}
index ea20055..e9139ed 100755 (executable)
@@ -33,7 +33,7 @@ for i in `seq 0 $posIB`; do
                        uci show meshwizard.netconfig | grep $IBwifi | while read line; do
                                oldline=$(echo $line | cut -d "=" -f 1)
                                uci set $oldline=""
-                               newline=$(echo $line |sed "s/$IBwifi/$syswifi/g")
+                               newline=$(echo $line |sed -e "s/$IBwifi/$syswifi/g" -e "s/'//g")
                                uci set $newline
                        done
                ;;
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/restore_default_config.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/restore_default_config.sh
deleted file mode 100755 (executable)
index 3f6ce35..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-# This will restore default "factory" settings before running the meshwizard
-# and is used when cleanup=1
-# Warning: This will reset network settings for wan and lan to defaults too.
-
-echo "+ Restore default config as requested with cleanup=1"
-cp -f /rom/etc/config/* /etc/config/
-rm /etc/config/wireless
-wifi detect > /etc/config/wireless
-rm /etc/config/network
-/etc/init.d/defconfig start
index bf47241..5265945 100755 (executable)
@@ -80,23 +80,30 @@ if [ ! "$no_masq_lan" == "1" ] && [ ! "$(uci -q get meshwizard.netconfig.lan_con
 fi
 
 
-# Rules, Forwardings, advanced config and includes
-
-for config in freifunk profile_$community; do
-
-       config_load $config
-
-       for section in advanced include fw_rule fw_forwarding; do
-               handle_firewall() {
-                       local options=$(uci show $config."$1")
-                       options=$(echo "$options" | sed -e "s/fw_//g" -e "s/^$config/firewall/g")
-                       for o in $options; do
-                               uci set $o
-                       done
-               }
-               config_foreach handle_firewall $section
-       done
-done
+# Rules, Forwardings, advanced config and includes from freifunk and
+# profile_$community config files.
+
+add_fw_rules() {
+    config_cb() {
+       local type="$1"
+       local name="$2"
+       local allowed_section_types="advanced include fw_rule fw_forwarding"
+       if is_in_list "$allowed_section_types" $type ; then
+           uci set firewall.${name}="${type/fw_/}"
+           option_cb() {
+               local option="$1"
+               local value="$2"
+               uci set firewall.${CONFIG_SECTION}.${option}="$value"
+           }
+       else
+           option_cb() { return; }
+       fi
+    }
+    config_load freifunk
+    config_load profile_${community}
+}
+add_fw_rules
+
 
 # If we use auto-ipv6-dhcp then allow 547/udp on the freifunk zone
 if [ "$ipv6_config" = "auto-ipv6-dhcpv6" ]; then
index 9d18a58..d212ca4 100755 (executable)
@@ -115,14 +115,29 @@ setup_watchdog() {
 }
 
 setup_jsoninfo() {
-    # Setup jsoninfo
+       proto="$1"
        uci batch <<- EOF
                set $cfg.olsrd_jsoninfo=LoadPlugin
                set $cfg.olsrd_jsoninfo.library="olsrd_jsoninfo.so.0.0"
        EOF
-    uci_commitverbose "Setup olsr jsoninfo plugin" $cfg
+       if [ "$proto" = "6" ]; then
+               uci set $cfg.olsrd_jsoninfo.ipv6only='1'
+       fi
+       uci_commitverbose "Setup olsr jsoninfo plugin" $cfg
 }
 
+setup_txtinfo() {
+       proto="$1"
+       uci batch <<- EOF
+           set $cfg.olsrd_txtinfo=LoadPlugin
+           set $cfg.olsrd_txtinfo.library="olsrd_txtinfo.so.0.1"
+       EOF
+       if [ "$proto" = "6" ]; then
+               uci set $cfg.olsrd_txtinfo.ipv6only='1'
+       fi
+       uci_commitverbose "Setup olsr txtinfo plugin" $cfg
+} 
+
 
 for proto in $protocols; do
     cfg="olsrd"
@@ -140,6 +155,6 @@ for proto in $protocols; do
     setup_nameservice
     setup_dyngw_plain
     setup_watchdog
-    setup_jsoninfo
-
+    setup_jsoninfo $proto
+    setup_txtinfo $proto
 done
index 77c6cd9..b666313 100755 (executable)
@@ -9,15 +9,16 @@
 # You may not use this file except in compliance with the License.
 # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 
-. /lib/functions.sh
-
 echo "
-/* Meshwizard 0.2.0 */
+/* Meshwizard 0.3.0 */
 "
 
 # config
 export dir="/usr/bin/meshwizard"
+
+. /lib/functions.sh
 . $dir/functions.sh
+. $dir/helpers/read_defaults.sh
 [ -f /proc/net/ipv6_route ] && export has_ipv6=1
 
 # Check which packages we have installed
@@ -28,30 +29,26 @@ opkg list_installed |grep luci-app-splash > /dev/null && export has_luci_splash=
 
 # Check whether we want to cleanup/restore uci config before setting new options
 cleanup=$(uci -q get meshwizard.general.cleanup)
-[ "$cleanup" == 1 ] && $dir/helpers/restore_default_config.sh
+[ "$cleanup" == 1 ] && restore_factory_defaults
 
 # Rename wifi interfaces
 $dir/helpers/rename-wifi.sh
 
 # Get community
-community=$(uci -q get meshwizard.community.name || uci -q get freifunk.community.name)
+community="$(uci -q get meshwizard.community.name || uci -q get freifunk.community.name)"
 [ -z "$community" ] && echo "Error: Community is not set in /etc/config/freifunk, aborting now." && exit 1
 export community="$community"
-echo $community
+
+# we need a list of widgets later on. It will be populated in read_defaults.sh
+local widgets=""
 
 # Get a list of networks we need to setup
 networks=$(uci show meshwizard.netconfig | grep -v "netconfig=" | sed -e 's/meshwizard.netconfig\.\(.*\)\_.*/\1/' |sort|uniq)
 export networks
 [ -z "$networks" ] && echo "Error: No networks to setup could be found in /etc/config/meshwizard, aborting now." && exit 1
 
-# Read default values (first from /etc/config/freifunk, then from /etc/config/profile_$community
-# then /etc/config/meshwizard
-# last will overwrite first
-
-$dir/helpers/read_defaults.sh $community > /tmp/meshwizard.tmp
-while read line; do
-       export "${line//\"/}"
-done < /tmp/meshwizard.tmp
+# Read defaults and node config
+read_defaults $community
 
 # Do config
 $dir/helpers/initial_config.sh
index 34de44a..45c9189 100644 (file)
@@ -12,6 +12,7 @@ require("luci.http")
 local fs         = require("nixio.fs")
 local uci        = require("luci.model.uci")
 local datatypes  = require("luci.cbi.datatypes")
+local dispatcher = require("luci.dispatcher")
 local class      = util.class
 local instanceof = util.instanceof
 
@@ -307,8 +308,30 @@ function Map.__init__(self, config, ...)
 
        self.changed = false
 
-       if not self.uci:load(self.config) then
-               error("Unable to read UCI data: " .. self.config)
+       local path = "%s/%s" %{ self.uci:get_confdir(), self.config }
+       if fs.stat(path, "type") ~= "reg" then
+               fs.writefile(path, "")
+       end
+
+       local ok, err = self.uci:load(self.config)
+       if not ok then
+               local url = dispatcher.build_url(unpack(dispatcher.context.request))
+               local source = self:formvalue("cbi.source")
+               if type(source) == "string" then
+                       fs.writefile(path, source:gsub("\r\n", "\n"))
+                       ok, err = self.uci:load(self.config)
+                       if ok then
+                               luci.http.redirect(url)
+                       end
+               end
+               self.save = false
+       end
+
+       if not ok then
+               self.template   = "cbi/error"
+               self.error      = err
+               self.source     = fs.readfile(path) or ""
+               self.pageaction = false
        end
 end
 
diff --git a/modules/luci-base/luasrc/view/cbi/error.htm b/modules/luci-base/luasrc/view/cbi/error.htm
new file mode 100644 (file)
index 0000000..2acb969
--- /dev/null
@@ -0,0 +1,19 @@
+<div class="cbi-map" id="cbi-<%=self.config%>">
+       <% if self.title and #self.title > 0 then %><h2><a id="content" name="content"><%=self.title%></a></h2><% end %>
+       <% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
+
+       <p class="alert-message danger">
+               <%: The configuration file could not be loaded due to the following error: %><br />
+               <code><%=pcdata(self.error)%></code>
+       </p>
+
+       <textarea name="cbi.source" style="width:100%; margin-bottom:1em" rows="<%=math.max(self.source:cmatch("\n"), 10)%>"><%=pcdata(self.source)%></textarea>
+
+       <p class="alert-message">
+               <%: Edit the raw configuration data above to fix any error and hit "Save" to reload the page. %>
+       </p>
+
+       <div class="cbi-page-actions">
+               <input class="cbi-button cbi-button-apply" type="submit" name="cbi.save" value="<%:Save%>" />
+       </div>
+</div>
index 4aa454e..2252e7c 100644 (file)
@@ -775,6 +775,11 @@ msgstr "Mètode EAP"
 msgid "Edit"
 msgstr "Edita"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Edita aquesta interfície"
 
@@ -2474,6 +2479,9 @@ msgstr ""
 "Els caràcters permets són: <code>A-Z</code>, <code>a-z</code>, <code>0-9</"
 "code> i <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 0d89b28..3736020 100644 (file)
@@ -785,6 +785,11 @@ msgstr "Metoda EAP"
 msgid "Edit"
 msgstr "Upravit"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Upravit toto rozhraní"
 
@@ -2529,6 +2534,9 @@ msgstr ""
 "Povolené znaky jsou: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> a "
 "<code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 3ac0c52..361abde 100644 (file)
@@ -781,6 +781,11 @@ msgstr "EAP-Methode"
 msgid "Edit"
 msgstr "Bearbeiten"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Diese Schnittstelle bearbeiten"
 
@@ -2544,6 +2549,9 @@ msgstr ""
 "Erlaubte Buchstaben sind: <code>A-Z</code>, <code>a-z</code>, <code>0-9</"
 "code> and <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 5451adb..ed3a207 100644 (file)
@@ -797,6 +797,11 @@ msgstr "Μέθοδος EAP"
 msgid "Edit"
 msgstr "Επεξεργασία"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Επεξεργασία αυτής της διεπαφής"
 
@@ -2506,6 +2511,9 @@ msgstr ""
 "Οι επιτρεπόμενοι χαρακτήρες είναι: <code>A-Z</code>, <code>a-z</code>, "
 "<code>0-9</code> και <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index c75b4ca..3ad4b14 100644 (file)
@@ -776,6 +776,11 @@ msgstr "EAP-Method"
 msgid "Edit"
 msgstr "Edit"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr ""
 
@@ -2466,6 +2471,9 @@ msgid ""
 "code> and <code>_</code>"
 msgstr ""
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index d187fe7..2c3ce94 100644 (file)
@@ -791,6 +791,11 @@ msgstr "Método EAP"
 msgid "Edit"
 msgstr "Editar"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Editar esta interfaz"
 
@@ -2549,6 +2554,9 @@ msgstr ""
 "Los caracteres permitidos son: <code>A-Z</code>, <code>a-z</code>, "
 "<code>0-9</code> y <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 3b209b3..1d8d224 100644 (file)
@@ -801,6 +801,11 @@ msgstr "Méthode EAP"
 msgid "Edit"
 msgstr "Éditer"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Éditer cette interface"
 
@@ -2561,6 +2566,9 @@ msgstr ""
 "Les caractères autorisés sont : <code>A-Z</code>, <code>a-z</code>, "
 "<code>0-9</code> et <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index cbc27d3..237e868 100644 (file)
@@ -762,6 +762,11 @@ msgstr ""
 msgid "Edit"
 msgstr "ערוך"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "ערוך ממשק זה"
 
@@ -2440,6 +2445,9 @@ msgid ""
 "code> and <code>_</code>"
 msgstr ""
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 47f0dfe..975bf2d 100644 (file)
@@ -794,6 +794,11 @@ msgstr "EAP metódus"
 msgid "Edit"
 msgstr "Szerkesztés"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Interfész szerkesztése"
 
@@ -2550,6 +2555,9 @@ msgstr ""
 "A következő karakterek használhatók: <code>A-Z</code>, <code>a-z</code>, "
 "<code>0-9</code> and <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index b6f9444..771025e 100644 (file)
@@ -795,6 +795,11 @@ msgstr "Metodo EAP"
 msgid "Edit"
 msgstr "Modifica"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Modifica questa interfaccia"
 
@@ -2532,6 +2537,9 @@ msgid ""
 "code> and <code>_</code>"
 msgstr ""
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 69c384c..8bea764 100644 (file)
@@ -783,6 +783,11 @@ msgstr "EAPメソッド"
 msgid "Edit"
 msgstr "編集"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "インターフェースを編集"
 
@@ -2523,6 +2528,9 @@ msgstr ""
 "使用可能な文字は右記の通りです: <code>A-Z</code>, <code>a-z</code>, "
 "<code>0-9</code>, <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index aaa1bc4..d2a34df 100644 (file)
@@ -746,6 +746,11 @@ msgstr "EAP-Kaedah"
 msgid "Edit"
 msgstr "Sunting"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr ""
 
@@ -2441,6 +2446,9 @@ msgstr ""
 "Karakter yang diizinkan adalah: <code>A-Z</code>, <code>a-z</code>, "
 "<code>0-9</code> dan <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index f742920..21176ed 100644 (file)
@@ -781,6 +781,11 @@ msgstr "EAP-metode"
 msgid "Edit"
 msgstr "Endre"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Endre dette grensesnittet"
 
@@ -2521,6 +2526,9 @@ msgstr ""
 "Gyldige tegn er: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> og "
 "<code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 908b6e6..baa7ab8 100644 (file)
@@ -808,6 +808,11 @@ msgstr "Metoda EAP"
 msgid "Edit"
 msgstr "Edycja"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Edytuj ten interfejs"
 
@@ -2577,6 +2582,9 @@ msgstr ""
 "Dozwolone znaki to: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> "
 "oraz <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index e9c68b2..ec4401b 100644 (file)
@@ -804,6 +804,11 @@ msgstr "Método EAP"
 msgid "Edit"
 msgstr "Editar"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Editar esta interface"
 
@@ -2581,6 +2586,9 @@ msgstr ""
 "Os caracteres permitidos são: <code>A-Z</code>, <code>a-z</code>, <code>0-9</"
 "code> e <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 2ba5ed7..1acc852 100644 (file)
@@ -797,6 +797,11 @@ msgstr "Metodo-EAP"
 msgid "Edit"
 msgstr "Editar"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Editar esta interface"
 
@@ -2525,6 +2530,9 @@ msgstr ""
 "Os caracteres permitidos são: <code>A-Z</code>, <code>a-z</code>, <code>0-9</"
 "code> e <code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index efc0bb4..3692b7d 100644 (file)
@@ -753,6 +753,11 @@ msgstr ""
 msgid "Edit"
 msgstr "Editeaza"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Editeaza aceasta interfata"
 
@@ -2430,6 +2435,9 @@ msgid ""
 "code> and <code>_</code>"
 msgstr ""
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index ea5ccf1..94fa6fb 100644 (file)
@@ -797,6 +797,11 @@ msgstr "Метод EAP"
 msgid "Edit"
 msgstr "Редактировать"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 #, fuzzy
 msgid "Edit this interface"
 msgstr "Редактировать этот интерфейс"
@@ -2553,6 +2558,9 @@ msgstr ""
 "Допустимые символы: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> и "
 "<code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index ff5b6dd..d943ccb 100644 (file)
@@ -733,6 +733,11 @@ msgstr ""
 msgid "Edit"
 msgstr ""
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr ""
 
@@ -2401,6 +2406,9 @@ msgid ""
 "code> and <code>_</code>"
 msgstr ""
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 9e10acd..86fa224 100644 (file)
@@ -739,6 +739,11 @@ msgstr ""
 msgid "Edit"
 msgstr ""
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr ""
 
@@ -2407,6 +2412,9 @@ msgid ""
 "code> and <code>_</code>"
 msgstr ""
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index fa7d6d8..1bf53aa 100644 (file)
@@ -746,6 +746,11 @@ msgstr ""
 msgid "Edit"
 msgstr ""
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr ""
 
@@ -2414,6 +2419,9 @@ msgid ""
 "code> and <code>_</code>"
 msgstr ""
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index de1e461..c548322 100644 (file)
@@ -807,6 +807,11 @@ msgstr "EAP-Метод"
 msgid "Edit"
 msgstr "Редагувати"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "Редагувати цей інтерфейс"
 
@@ -2568,6 +2573,9 @@ msgstr ""
 "Дозволені символи: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> та "
 "<code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index cdbabd4..d81be16 100644 (file)
@@ -751,6 +751,11 @@ msgstr "EAP-Method"
 msgid "Edit"
 msgstr "Chỉnh sửa"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr ""
 
@@ -2441,6 +2446,9 @@ msgid ""
 "code> and <code>_</code>"
 msgstr ""
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
index 47aa60f..72bf937 100644 (file)
@@ -410,9 +410,6 @@ msgstr "CA证书.如果留空的话证书将在第一次连接时被保存."
 msgid "CPU"
 msgstr "CPU"
 
-msgid "CPU frequency"
-msgstr "CPU 频率"
-
 msgid "CPU usage (%)"
 msgstr "CPU使用率(%)"
 
@@ -443,9 +440,6 @@ msgstr "检查"
 msgid "Checksum"
 msgstr "校验值"
 
-msgid "Chip Model"
-msgstr "芯片型号"
-
 msgid ""
 "Choose the firewall zone you want to assign to this interface. Select "
 "<em>unspecified</em> to remove the interface from the associated zone or "
@@ -758,6 +752,11 @@ msgstr "EAP-Method"
 msgid "Edit"
 msgstr "修改"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "修改此接口"
 
@@ -2453,6 +2452,9 @@ msgstr ""
 "合法字符:<code>A-Z</code>, <code>a-z</code>, <code>0-9</code> 和 <code>_</"
 "code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
@@ -3116,6 +3118,12 @@ msgstr "是"
 msgid "« Back"
 msgstr "« 后退"
 
+#~ msgid "CPU frequency"
+#~ msgstr "CPU 频率"
+
+#~ msgid "Chip Model"
+#~ msgstr "芯片型号"
+
 #~ msgid ""
 #~ "Always use 40MHz channels even if the secondary channel overlaps. Using "
 #~ "this option does not comply with IEEE 802.11n-2009!"
index a2ec282..ec901b8 100644 (file)
@@ -763,6 +763,11 @@ msgstr "EAP協定驗證方式"
 msgid "Edit"
 msgstr "編輯"
 
+msgid ""
+"Edit the raw configuration data above to fix any error and hit \"Save\" to "
+"reload the page."
+msgstr ""
+
 msgid "Edit this interface"
 msgstr "修改這個介面"
 
@@ -2468,6 +2473,9 @@ msgstr ""
 "所允許的字元是: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code> and "
 "<code>_</code>"
 
+msgid "The configuration file could not be loaded due to the following error:"
+msgstr ""
+
 msgid ""
 "The device file of the memory or partition (<abbr title=\"for example\">e.g."
 "</abbr> <code>/dev/sda1</code>)"
diff --git a/modules/luci-base/root/lib/uci/upload/.gitignore b/modules/luci-base/root/lib/uci/upload/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/modules/luci-base/root/lib/uci/upload/.placeholder b/modules/luci-base/root/lib/uci/upload/.placeholder
new file mode 100644 (file)
index 0000000..e69de29
index 019e404..0d3d971 100644 (file)
@@ -5,7 +5,7 @@
 local fs = require "nixio.fs"
 local util = require "luci.util"
 local uci = require "luci.model.uci".cursor()
-local profiles = "/etc/config/profile_"
+local profiles = "/etc/config/profile_*"
 
 m = Map("freifunk", translate ("Community"))
 c = m:section(NamedSection, "community", "public", nil, translate("These are the basic settings for your local wireless community. These settings define the default values for the wizard and DO NOT affect the actual configuration of the router."))
@@ -14,7 +14,7 @@ community = c:option(ListValue, "name", translate ("Community"))
 community.rmempty = false
 
 local profile
-for profile in fs.dir(profiles) do
+for profile in fs.glob(profiles) do
        local name = uci:get_first(profile, "community", "name") or "?"
        community:value(profile, name)
 end