diff options
53 files changed, 513 insertions, 226 deletions
diff --git a/applications/luci-app-ddns/Makefile b/applications/luci-app-ddns/Makefile index a2d2ae947..0e1e5df4c 100644 --- a/applications/luci-app-ddns/Makefile +++ b/applications/luci-app-ddns/Makefile @@ -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 diff --git a/applications/luci-app-ddns/luasrc/tools/ddns.lua b/applications/luci-app-ddns/luasrc/tools/ddns.lua index 6d5393146..4466063cb 100644 --- a/applications/luci-app-ddns/luasrc/tools/ddns.lua +++ b/applications/luci-app-ddns/luasrc/tools/ddns.lua @@ -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 diff --git a/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd b/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd index a7c433f2b..689bedcd1 100644 --- a/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd +++ b/applications/luci-app-fwknopd/root/etc/uci-defaults/luci-fwknopd @@ -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 diff --git a/applications/luci-app-olsr/luasrc/controller/olsr.lua b/applications/luci-app-olsr/luasrc/controller/olsr.lua index 74deb716c..cfadd9b7c 100644 --- a/applications/luci-app-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-app-olsr/luasrc/controller/olsr.lua @@ -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 = {} diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm index 0a81d17b4..fa3231528 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm @@ -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> diff --git a/applications/luci-app-privoxy/Makefile b/applications/luci-app-privoxy/Makefile index bc2c57ee9..3d87a417f 100644 --- a/applications/luci-app-privoxy/Makefile +++ b/applications/luci-app-privoxy/Makefile @@ -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 diff --git a/applications/luci-app-privoxy/luasrc/controller/privoxy.lua b/applications/luci-app-privoxy/luasrc/controller/privoxy.lua index 9ffc404ce..58ba80724 100755..100644 --- a/applications/luci-app-privoxy/luasrc/controller/privoxy.lua +++ b/applications/luci-app-privoxy/luasrc/controller/privoxy.lua @@ -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 diff --git a/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua b/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua index c009313e3..c415f8e06 100755..100644 --- a/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua +++ b/applications/luci-app-privoxy/luasrc/model/cbi/privoxy.lua @@ -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 diff --git a/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm b/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm index 3e190709f..3e190709f 100755..100644 --- a/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm +++ b/applications/luci-app-privoxy/luasrc/view/privoxy/detail_logview.htm diff --git a/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua b/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua index 99a884f86..a8ea57e31 100644 --- a/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua +++ b/applications/luci-app-qos/luasrc/model/cbi/qos/qos.lua @@ -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") diff --git a/applications/luci-app-radicale/Makefile b/applications/luci-app-radicale/Makefile index 07998aee5..960618dba 100644 --- a/applications/luci-app-radicale/Makefile +++ b/applications/luci-app-radicale/Makefile @@ -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 diff --git a/applications/luci-app-radicale/luasrc/controller/radicale.lua b/applications/luci-app-radicale/luasrc/controller/radicale.lua index 662c60d5a..d384b00d9 100755..100644 --- a/applications/luci-app-radicale/luasrc/controller/radicale.lua +++ b/applications/luci-app-radicale/luasrc/controller/radicale.lua @@ -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 diff --git a/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua b/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua index 8abb68869..8abb68869 100755..100644 --- a/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua +++ b/applications/luci-app-radicale/luasrc/model/cbi/radicale.lua diff --git a/applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh b/applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh index 76f6d4d3e..da8370daf 100755 --- a/applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh +++ b/applications/luci-app-splash/htdocs/cgi-bin/splash/splash.sh @@ -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" diff --git a/contrib/package/community-profiles/files/etc/config/profile_augsburg b/contrib/package/community-profiles/files/etc/config/profile_augsburg index 4434b0fba..4ab82cf5d 100644 --- a/contrib/package/community-profiles/files/etc/config/profile_augsburg +++ b/contrib/package/community-profiles/files/etc/config/profile_augsburg @@ -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' diff --git a/contrib/package/community-profiles/files/etc/config/profile_reihen b/contrib/package/community-profiles/files/etc/config/profile_reihen index e978d3750..a05d6a296 100644 --- a/contrib/package/community-profiles/files/etc/config/profile_reihen +++ b/contrib/package/community-profiles/files/etc/config/profile_reihen @@ -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' diff --git a/contrib/package/meshwizard/Makefile b/contrib/package/meshwizard/Makefile index 9d74fe547..6959c544c 100644 --- a/contrib/package/meshwizard/Makefile +++ b/contrib/package/meshwizard/Makefile @@ -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) diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh index 8abdf9f0e..8ace21853 100644 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh @@ -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 +} 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 cb0d319a2..b6ffb62e4 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 @@ -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" +} diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh index ea200559e..e9139ed51 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh @@ -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 index 3f6ce3587..000000000 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/restore_default_config.sh +++ /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 diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh index bf4724112..52659457d 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh @@ -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 diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh index 9d18a582a..d212ca472 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh @@ -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 diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh index 77c6cd95e..b666313e4 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh @@ -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 diff --git a/modules/luci-base/luasrc/cbi.lua b/modules/luci-base/luasrc/cbi.lua index 34de44a5f..45c91890a 100644 --- a/modules/luci-base/luasrc/cbi.lua +++ b/modules/luci-base/luasrc/cbi.lua @@ -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 index 000000000..2acb96924 --- /dev/null +++ b/modules/luci-base/luasrc/view/cbi/error.htm @@ -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> diff --git a/modules/luci-base/po/ca/base.po b/modules/luci-base/po/ca/base.po index 4aa454e7b..2252e7c95 100644 --- a/modules/luci-base/po/ca/base.po +++ b/modules/luci-base/po/ca/base.po @@ -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>)" diff --git a/modules/luci-base/po/cs/base.po b/modules/luci-base/po/cs/base.po index 0d89b28aa..373602070 100644 --- a/modules/luci-base/po/cs/base.po +++ b/modules/luci-base/po/cs/base.po @@ -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>)" diff --git a/modules/luci-base/po/de/base.po b/modules/luci-base/po/de/base.po index 3ac0c52e2..361abdead 100644 --- a/modules/luci-base/po/de/base.po +++ b/modules/luci-base/po/de/base.po @@ -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>)" diff --git a/modules/luci-base/po/el/base.po b/modules/luci-base/po/el/base.po index 5451adb47..ed3a20737 100644 --- a/modules/luci-base/po/el/base.po +++ b/modules/luci-base/po/el/base.po @@ -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>)" diff --git a/modules/luci-base/po/en/base.po b/modules/luci-base/po/en/base.po index c75b4cab3..3ad4b140b 100644 --- a/modules/luci-base/po/en/base.po +++ b/modules/luci-base/po/en/base.po @@ -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>)" diff --git a/modules/luci-base/po/es/base.po b/modules/luci-base/po/es/base.po index d187fe7bd..2c3ce94ad 100644 --- a/modules/luci-base/po/es/base.po +++ b/modules/luci-base/po/es/base.po @@ -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>)" diff --git a/modules/luci-base/po/fr/base.po b/modules/luci-base/po/fr/base.po index 3b209b349..1d8d22475 100644 --- a/modules/luci-base/po/fr/base.po +++ b/modules/luci-base/po/fr/base.po @@ -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>)" diff --git a/modules/luci-base/po/he/base.po b/modules/luci-base/po/he/base.po index cbc27d316..237e8689a 100644 --- a/modules/luci-base/po/he/base.po +++ b/modules/luci-base/po/he/base.po @@ -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>)" diff --git a/modules/luci-base/po/hu/base.po b/modules/luci-base/po/hu/base.po index 47f0dfedb..975bf2dfc 100644 --- a/modules/luci-base/po/hu/base.po +++ b/modules/luci-base/po/hu/base.po @@ -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>)" diff --git a/modules/luci-base/po/it/base.po b/modules/luci-base/po/it/base.po index b6f94443e..771025e27 100644 --- a/modules/luci-base/po/it/base.po +++ b/modules/luci-base/po/it/base.po @@ -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>)" diff --git a/modules/luci-base/po/ja/base.po b/modules/luci-base/po/ja/base.po index 69c384c50..8bea7644e 100644 --- a/modules/luci-base/po/ja/base.po +++ b/modules/luci-base/po/ja/base.po @@ -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>)" diff --git a/modules/luci-base/po/ms/base.po b/modules/luci-base/po/ms/base.po index aaa1bc4ca..d2a34dfbe 100644 --- a/modules/luci-base/po/ms/base.po +++ b/modules/luci-base/po/ms/base.po @@ -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>)" diff --git a/modules/luci-base/po/no/base.po b/modules/luci-base/po/no/base.po index f7429201f..21176ed3f 100644 --- a/modules/luci-base/po/no/base.po +++ b/modules/luci-base/po/no/base.po @@ -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>)" diff --git a/modules/luci-base/po/pl/base.po b/modules/luci-base/po/pl/base.po index 908b6e601..baa7ab853 100644 --- a/modules/luci-base/po/pl/base.po +++ b/modules/luci-base/po/pl/base.po @@ -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>)" diff --git a/modules/luci-base/po/pt-br/base.po b/modules/luci-base/po/pt-br/base.po index e9c68b225..ec4401bde 100644 --- a/modules/luci-base/po/pt-br/base.po +++ b/modules/luci-base/po/pt-br/base.po @@ -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>)" diff --git a/modules/luci-base/po/pt/base.po b/modules/luci-base/po/pt/base.po index 2ba5ed7b4..1acc852bb 100644 --- a/modules/luci-base/po/pt/base.po +++ b/modules/luci-base/po/pt/base.po @@ -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>)" diff --git a/modules/luci-base/po/ro/base.po b/modules/luci-base/po/ro/base.po index efc0bb450..3692b7de5 100644 --- a/modules/luci-base/po/ro/base.po +++ b/modules/luci-base/po/ro/base.po @@ -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>)" diff --git a/modules/luci-base/po/ru/base.po b/modules/luci-base/po/ru/base.po index ea5ccf163..94fa6fb8e 100644 --- a/modules/luci-base/po/ru/base.po +++ b/modules/luci-base/po/ru/base.po @@ -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>)" diff --git a/modules/luci-base/po/sk/base.po b/modules/luci-base/po/sk/base.po index ff5b6dde0..d943ccb89 100644 --- a/modules/luci-base/po/sk/base.po +++ b/modules/luci-base/po/sk/base.po @@ -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>)" diff --git a/modules/luci-base/po/sv/base.po b/modules/luci-base/po/sv/base.po index 9e10acda3..86fa224e7 100644 --- a/modules/luci-base/po/sv/base.po +++ b/modules/luci-base/po/sv/base.po @@ -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>)" diff --git a/modules/luci-base/po/tr/base.po b/modules/luci-base/po/tr/base.po index fa7d6d800..1bf53aa57 100644 --- a/modules/luci-base/po/tr/base.po +++ b/modules/luci-base/po/tr/base.po @@ -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>)" diff --git a/modules/luci-base/po/uk/base.po b/modules/luci-base/po/uk/base.po index de1e461ab..c5483221c 100644 --- a/modules/luci-base/po/uk/base.po +++ b/modules/luci-base/po/uk/base.po @@ -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>)" diff --git a/modules/luci-base/po/vi/base.po b/modules/luci-base/po/vi/base.po index cdbabd4cf..d81be16eb 100644 --- a/modules/luci-base/po/vi/base.po +++ b/modules/luci-base/po/vi/base.po @@ -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>)" diff --git a/modules/luci-base/po/zh-cn/base.po b/modules/luci-base/po/zh-cn/base.po index 47aa60f66..72bf93795 100644 --- a/modules/luci-base/po/zh-cn/base.po +++ b/modules/luci-base/po/zh-cn/base.po @@ -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!" diff --git a/modules/luci-base/po/zh-tw/base.po b/modules/luci-base/po/zh-tw/base.po index a2ec282dd..ec901b8af 100644 --- a/modules/luci-base/po/zh-tw/base.po +++ b/modules/luci-base/po/zh-tw/base.po @@ -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/.placeholder index e69de29bb..e69de29bb 100644 --- a/modules/luci-base/root/lib/uci/upload/.gitignore +++ b/modules/luci-base/root/lib/uci/upload/.placeholder diff --git a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua index 019e404ef..0d3d971c3 100644 --- a/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua +++ b/modules/luci-mod-freifunk/luasrc/model/cbi/freifunk/basics.lua @@ -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 |