From ab87896104be09072ccccad305588d46370ab5ad Mon Sep 17 00:00:00 2001 From: Manuel Munz Date: Thu, 23 Jun 2011 15:52:00 +0000 Subject: Add new meshwizard (WIP) --- applications/luci-meshwizard/Makefile | 4 + applications/luci-meshwizard/ipkg/postinst | 8 ++ .../luasrc/controller/meshwizard.lua | 21 +++ .../luasrc/model/cbi/freifunk/meshwizard.lua | 149 ++++++++++++++++++++ contrib/package/luci/Makefile | 7 +- contrib/package/meshwizard/Makefile | 39 ++++++ .../package/meshwizard/files/etc/config/meshwizard | 7 + .../files/usr/bin/meshwizard/functions.sh | 63 +++++++++ .../bin/meshwizard/helpers/check-range-in-range.sh | 31 ++++ .../files/usr/bin/meshwizard/helpers/common.awk | 20 +++ .../files/usr/bin/meshwizard/helpers/gen_bssid.sh | 33 +++++ .../usr/bin/meshwizard/helpers/gen_dhcp_ip.sh | 6 + .../usr/bin/meshwizard/helpers/initial_config.sh | 59 ++++++++ .../usr/bin/meshwizard/helpers/ipcalc-cidr.sh | 41 ++++++ .../usr/bin/meshwizard/helpers/read_defaults.sh | 20 +++ .../usr/bin/meshwizard/helpers/rename-wifi.sh | 43 ++++++ .../files/usr/bin/meshwizard/helpers/setup_dhcp.sh | 33 +++++ .../usr/bin/meshwizard/helpers/setup_dnsmasq.sh | 31 ++++ .../usr/bin/meshwizard/helpers/setup_firewall.sh | 156 +++++++++++++++++++++ .../usr/bin/meshwizard/helpers/setup_network.sh | 91 ++++++++++++ .../usr/bin/meshwizard/helpers/setup_olsrd.sh | 126 +++++++++++++++++ .../usr/bin/meshwizard/helpers/setup_splash.sh | 32 +++++ .../files/usr/bin/meshwizard/helpers/setup_wifi.sh | 107 ++++++++++++++ .../meshwizard/files/usr/bin/meshwizard/wizard.sh | 96 +++++++++++++ modules/freifunk/root/etc/config/freifunk | 60 ++++++-- modules/freifunk/root/etc/config/profile_-custom | 10 -- modules/freifunk/root/etc/config/profile_Freifunk | 10 ++ modules/freifunk/root/etc/config/profile_augsburg | 4 + po/ca/meshwizard.po | 81 +++++++++++ po/de/meshwizard.po | 81 +++++++++++ po/el/meshwizard.po | 81 +++++++++++ po/en/meshwizard.po | 81 +++++++++++ po/es/meshwizard.po | 81 +++++++++++ po/fr/meshwizard.po | 81 +++++++++++ po/it/meshwizard.po | 81 +++++++++++ po/ja/meshwizard.po | 81 +++++++++++ po/ms/meshwizard.po | 81 +++++++++++ po/no/meshwizard.po | 81 +++++++++++ po/pl/meshwizard.po | 81 +++++++++++ po/pt/meshwizard.po | 81 +++++++++++ po/pt_BR/meshwizard.po | 81 +++++++++++ po/ru/meshwizard.po | 81 +++++++++++ po/templates/meshwizard.pot | 84 +++++++++++ po/vi/meshwizard.po | 81 +++++++++++ po/zh_CN/meshwizard.po | 81 +++++++++++ 45 files changed, 2661 insertions(+), 26 deletions(-) create mode 100644 applications/luci-meshwizard/Makefile create mode 100644 applications/luci-meshwizard/ipkg/postinst create mode 100644 applications/luci-meshwizard/luasrc/controller/meshwizard.lua create mode 100644 applications/luci-meshwizard/luasrc/model/cbi/freifunk/meshwizard.lua create mode 100644 contrib/package/meshwizard/Makefile create mode 100644 contrib/package/meshwizard/files/etc/config/meshwizard create mode 100644 contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/check-range-in-range.sh create mode 100644 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/common.awk create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/gen_bssid.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/gen_dhcp_ip.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/ipcalc-cidr.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh create mode 100755 contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh delete mode 100644 modules/freifunk/root/etc/config/profile_-custom create mode 100644 modules/freifunk/root/etc/config/profile_Freifunk create mode 100644 po/ca/meshwizard.po create mode 100644 po/de/meshwizard.po create mode 100644 po/el/meshwizard.po create mode 100644 po/en/meshwizard.po create mode 100644 po/es/meshwizard.po create mode 100644 po/fr/meshwizard.po create mode 100644 po/it/meshwizard.po create mode 100644 po/ja/meshwizard.po create mode 100644 po/ms/meshwizard.po create mode 100644 po/no/meshwizard.po create mode 100644 po/pl/meshwizard.po create mode 100644 po/pt/meshwizard.po create mode 100644 po/pt_BR/meshwizard.po create mode 100644 po/ru/meshwizard.po create mode 100644 po/templates/meshwizard.pot create mode 100644 po/vi/meshwizard.po create mode 100644 po/zh_CN/meshwizard.po diff --git a/applications/luci-meshwizard/Makefile b/applications/luci-meshwizard/Makefile new file mode 100644 index 000000000..7ff62bb98 --- /dev/null +++ b/applications/luci-meshwizard/Makefile @@ -0,0 +1,4 @@ +PO = mesh-wizard + +include ../../build/config.mk +include ../../build/module.mk diff --git a/applications/luci-meshwizard/ipkg/postinst b/applications/luci-meshwizard/ipkg/postinst new file mode 100644 index 000000000..ac4e1d122 --- /dev/null +++ b/applications/luci-meshwizard/ipkg/postinst @@ -0,0 +1,8 @@ +#!/bin/sh +[ -n "${IPKG_INSTROOT}" ] || { + uci set ucitrack.meshwizard="meshwizard" + uci set ucitrack.meshwizard.exec="/etc/init.d/wizard restart" + uci commit + exit 0 +} + diff --git a/applications/luci-meshwizard/luasrc/controller/meshwizard.lua b/applications/luci-meshwizard/luasrc/controller/meshwizard.lua new file mode 100644 index 000000000..4e930cc50 --- /dev/null +++ b/applications/luci-meshwizard/luasrc/controller/meshwizard.lua @@ -0,0 +1,21 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2011 Manuel Munz + +Licensed under the Apache License, Version 2.0 (the "License"); +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 + +]]-- + +module "luci.controller.meshwizard" + +function index() + require("luci.i18n").loadc("meshwizard") + local i18n = luci.i18n.translate + entry({"admin", "freifunk", "meshwizard"}, cbi("freifunk/meshwizard"), i18n("Mesh Wizard"), 40) +end + diff --git a/applications/luci-meshwizard/luasrc/model/cbi/freifunk/meshwizard.lua b/applications/luci-meshwizard/luasrc/model/cbi/freifunk/meshwizard.lua new file mode 100644 index 000000000..48fb90600 --- /dev/null +++ b/applications/luci-meshwizard/luasrc/model/cbi/freifunk/meshwizard.lua @@ -0,0 +1,149 @@ +-- wizard rewrite wip + +local uci = require "luci.model.uci".cursor() +local sys = require "luci.sys" +local util = require "luci.util" +local ip = require "luci.ip" + +local community = "profile_" .. (uci:get("freifunk", "community", "name") or "Freifunk") +mesh_network = ip.IPv4(uci:get_first(community, "community", "mesh_network") or "10.0.0.0/8") + +m = Map("meshwizard", translate("Wizard"), translate("This wizard will assist you in setting up your router for Freifunk " .. + "or another similar wireless community network.")) +--m:chain("meshwizard") + +n = m:section(TypedSection, "netconfig", translate("Interfaces")) +n.anonymous = true + +-- common functions + +function cbi_configure(device) + local configure = n:taboption(device, Flag, device .. "_config", translate("Configure this interface")) +end + +function cbi_ip4addr(device) + local ip4addr = n:taboption(device, Value, device .. "_ip4addr", translate("Mesh IP address"), + translate("This is a unique address in the mesh (e.g. 10.1.1.1) and has to be registered at your local community.")) + ip4addr:depends(device .. "_config", 1) + ip4addr.datatype = "ip4addr" + function ip4addr.validate(self, value) + local x = ip.IPv4(value) + if mesh_network:contains(x) then + return value + else + return nil, translate("The given IP address is not inside the mesh network range ") .. + "(" .. mesh_network:string() .. ")." + end + end +end + +function cbi_dhcp(device) + local dhcp = n:taboption(device, Flag, device .. "_dhcp", translate("Enable DHCP"), + translate("DHCP will automatically assign ip addresses to clients")) + dhcp:depends(device .. "_config", 1) + dhcp.rmempty = true +end + +function cbi_dhcprange(device) + local dhcprange = n:taboption(device, Value, device .. "_dhcprange", translate("DHCP IP range"), + translate("The IP range from which clients are assigned ip addresses (e.g. 10.1.2.1/28). " .. + "If this is a range inside your mesh network range, then it will be announced as HNA. Any other range will use NAT. " .. + "If left empty then the defaults from the community profile will be used.")) + dhcprange:depends(device .. "_dhcp", "1") + dhcprange.rmempty = true + dhcprange.datatype = "ip4addr" +end +-- create tabs and config for wireless +local nets={} +uci:foreach("wireless", "wifi-device", function(section) + local device = section[".name"] + table.insert(nets, device) +end) + +local wired_nets = {} +uci:foreach("network", "interface", function(section) + local device = section[".name"] + if not util.contains(nets, device) and device ~= "loopback" then + table.insert(nets, device) + table.insert(wired_nets, device) + end +end) + +for _, net in util.spairs(nets, function(a,b) return (nets[a] < nets[b]) end) do + n:tab(net, net) +end + +-- create cbi config for wireless +uci:foreach("wireless", "wifi-device", function(section) + local device = section[".name"] + local hwtype = section.type + local syscc = section.country or uci:get(community, "wifi_device", "country") or + uci:get("freifunk", "wifi_device", "country") + + cbi_configure(device) + + -- Channel selection + + if hwtype == "atheros" then + local cc = util.trim(sys.exec("grep -i '" .. syscc .. "' /lib/wifi/cc_translate.txt |cut -d ' ' -f 2")) or 0 + sys.exec('"echo " .. cc .. " > /proc/sys/dev/" .. device .. "/countrycode"') + elseif hwtype == "mac80211" then + sys.exec("iw reg set " .. syscc) + elseif hwtype == "broadcom" then + sys.exec ("wlc country " .. syscc) + end + + local chan = n:taboption(device, ListValue, device .. "_channel", translate("Channel"), + translate("Your device and neighbouring nodes have to use the same channel.")) + chan:depends(device .. "_config", 1) + chan:value('default') + + for _, f in ipairs(sys.wifi.channels(device)) do + if not f.restricted then + chan:value(f.channel) + end + end + -- IPv4 address + cbi_ip4addr(device) + + -- DHCP enable + cbi_dhcp(device) + + -- DHCP range + cbi_dhcprange(device) + + -- Enable VAP + if hwtype == "atheros" then + local vap = n:taboption(device, Flag, device .. "_vap", translate("Virtual Access Point (VAP)"), + translate("This will setup a new virtual wireless interface in Access Point mode.")) + vap:depends(device .. "_dhcp", "1") + vap.rmempty = true + end +end) + +for _, device in pairs(wired_nets) do + cbi_configure(device) + cbi_ip4addr(device) + cbi_dhcp(device) + cbi_dhcprange(device) +end + +g = m:section(TypedSection, "general", translate("General Settings")) +g.anonymous = true + +local cleanup = g:option(Flag, "cleanup", translate("Cleanup config"), + translate("If this is selected then config is cleaned before setting new config options.")) +cleanup.default = "1" + +local restrict = g:option(Flag, "local_restrict", translate("Protect LAN"), + translate("Check this to protect your LAN from other nodes or clients") .. " (" .. translate("recommended") .. ").") + +local share = g:option(Flag, "sharenet", translate("Share your internet connection"), + translate("Select this to allow others to use your connection to access the internet.")) + share.rmempty = true + +--function m.on_after_commit (self) +-- sys.call("/usr/bin/mesh-wizard/wizard.sh >/dev/null") +--end + +return m diff --git a/contrib/package/luci/Makefile b/contrib/package/luci/Makefile index 8f2f909c3..3965e51a9 100644 --- a/contrib/package/luci/Makefile +++ b/contrib/package/luci/Makefile @@ -197,9 +197,7 @@ define Package/luci-mod-freifunk-community SUBMENU:=Freifunk TITLE:=Freifunk Community Meta-Package DEPENDS+= \ - +luci-lib-web +luci-app-splash \ - +luci-app-ffwizard \ - +luci-i18n-german \ + +luci-lib-web +luci-app-splash +luci-i18n-german \ +PACKAGE_luci-mod-freifunk-community:olsrd +PACKAGE_luci-mod-freifunk-community:olsrd-mod-dyn-gw-plain \ +PACKAGE_luci-mod-freifunk-community:olsrd-mod-txtinfo +PACKAGE_luci-mod-freifunk-community:olsrd-mod-nameservice \ +PACKAGE_luci-mod-freifunk-community:olsrd-mod-watchdog +PACKAGE_luci-mod-freifunk-community:kmod-tun \ @@ -309,6 +307,9 @@ $(eval $(call application,firewall,Firmware and Portforwarding application,\ $(eval $(call application,freifunk-policyrouting,Policy routing for mesh traffic,\ +PACKAGE_luci-app-freifunk-policyrouting:freifunk-policyrouting +luci-mod-freifunk)) +$(eval $(call application,meshwizard, Shellscript based wizard to setup mesh networks,\ + +meshwizard +luci-mod-freifunk)) + $(eval $(call application,olsr,OLSR configuration and status module,\ +luci-mod-admin-full +PACKAGE_luci-app-olsr:olsrd +PACKAGE_luci-app-olsr:olsrd-mod-txtinfo)) diff --git a/contrib/package/meshwizard/Makefile b/contrib/package/meshwizard/Makefile new file mode 100644 index 000000000..d665b46a4 --- /dev/null +++ b/contrib/package/meshwizard/Makefile @@ -0,0 +1,39 @@ +# Copyright (C) 2011 Manuel Munz +# This is free software, licensed under the Apache 2.0 license. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=meshwizard +PKG_RELEASE:=1 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/meshwizard + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=Freifunk + TITLE:=Shell script based wizard for Mesh networks + DEPENDS:=+firewall +endef + +define Package/meshwizard/description + A shellscript based wizard to simplify the setup of a typical mesh node (e.g. for Freifunk.net) +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/meshwizard/install + $(CP) ./files/* $(1)/ +endef + +$(eval $(call BuildPackage,meshwizard)) diff --git a/contrib/package/meshwizard/files/etc/config/meshwizard b/contrib/package/meshwizard/files/etc/config/meshwizard new file mode 100644 index 000000000..a60b0cc44 --- /dev/null +++ b/contrib/package/meshwizard/files/etc/config/meshwizard @@ -0,0 +1,7 @@ +config 'netconfig' 'netconfig' + +config 'general' 'general' + option 'sharenet' '0' + option 'local_restrict' '1' + option 'cleanup' '1' + diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh new file mode 100644 index 000000000..5e0e19418 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/functions.sh @@ -0,0 +1,63 @@ +uci_remove_list_element() { + local option="$1" + local value="$2" + local list="$(uci get $option)" + local elem + + uci delete $option + for elem in $list; do + if [ "$elem" != "$value" ]; then + uci add_list $option=$elem + fi + done +} + +set_defaults() { + for def in $(env |grep "^$1"); do + option=${def/$1/} + uci set $2.$option + echo " ${option/=/: }" + done +} + +# 1 argument: section to remove +section_cleanup() { + uci -q delete $1 && msg_cleanup $1 || msg_cleanup_error $1 +} + +# 3 arguements: 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 +} + +msg_start() { + echo " Starting configuration of $1" +} + +msg_cleanup() { + echo " Cleanup: Removed section $1." +} + +msg_cleanup_error() { + echo -e " \033[1mWarning:\033[0m Cleanup of $1 failed." +} + +msg_missing_value() { + echo -e " \033[1mWarning:\033[0m Configuration option for $2 is missing in $1." +} + +msg_success() { + echo " Finished." +} + +msg_error() { + echo " \033[1mError: \033[0mThere was a problem." +} + +msg_rename() { + echo " Renamed unnamed section $1 to $2." +} + +msg_rename_error() { + echo " \033[1mWarning:\033[0m Could not rename $1 to $2." +} diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/check-range-in-range.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/check-range-in-range.sh new file mode 100755 index 000000000..c889c55ed --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/check-range-in-range.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# Checks whether a netrange is inside another netrange, returns 1 if true +# Takes two arguments: $1: net from which we want to know if it is inside $2 +# nets need to be given in CIDR notation + +dir=$(dirname $0) + +awk -f $dir/common.awk -f - $* <= network2) { + if (network <= broadcast2) { + if (broadcast <= broadcast2) { + print "1" + } + } + } +} +EOF diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/common.awk b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/common.awk new file mode 100644 index 000000000..5b03d06be --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/common.awk @@ -0,0 +1,20 @@ +function bitcount(c) { + c=and(rshift(c, 1),0x55555555)+and(c,0x55555555) + c=and(rshift(c, 2),0x33333333)+and(c,0x33333333) + c=and(rshift(c, 4),0x0f0f0f0f)+and(c,0x0f0f0f0f) + c=and(rshift(c, 8),0x00ff00ff)+and(c,0x00ff00ff) + c=and(rshift(c,16),0x0000ffff)+and(c,0x0000ffff) + return c +} + +function ip2int(ip) { + for (ret=0,n=split(ip,a,"\."),x=1;x<=n;x++) ret=or(lshift(ret,8),a[x]) + return ret +} + +function int2ip(ip,ret,x) { + ret=and(ip,255) + ip=rshift(ip,8) + for(;x<3;ret=and(ip,255)"."ret,ip=rshift(ip,8),x++); + return ret +} diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/gen_bssid.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/gen_bssid.sh new file mode 100755 index 000000000..fa042abae --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/gen_bssid.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# create essid from channel, takes two args: +# $1 = channel (integer) +# $2 = community (optional) +channel=$1 +community=$2 + +. /etc/functions.sh + + +# Try to get BSSID from profile first +config_load profile_$community +config_get bssid bssidscheme $channel + +if [ -z "$bssid" ]; then + case $channel in + [1-9]) + bssid="$(printf "%X\n" $channel)2:CA:FF:EE:BA:BE" + ;; + 1[0-4]) + bssid="$(printf "%X\n" $channel)2:CA:FF:EE:BA:BE" + ;; + [3-9][0-9]) + bssid="00:$channel:CA:FF:EE:EE" + ;; + 1[0-9][0-9]) + bssid="${channel/1/01:}:CA:FF:EE:EE" + ;; + *) bssid="02:CA:FF:EE:BA:BE" + ;; + esac +fi +echo $bssid diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/gen_dhcp_ip.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/gen_dhcp_ip.sh new file mode 100755 index 000000000..e559166f4 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/gen_dhcp_ip.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# generates a dhcp-ip and netrange from a given ip/subnet +# takes 2 arguments: +# $1: Ip Address (of the Interface for which we want to generate an ip) + +echo "$1" | awk 'BEGIN { FS = "." } ; { print "6."$3"."$4".1" }' diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh new file mode 100755 index 000000000..a5f670dd5 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/initial_config.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# This is only run once (usually after flashing an image from the imagebuilder) +# It sets up the initial config for this node. + + +. /etc/functions.sh +. $dir/functions.sh + +### System config + +config_load system + +# Rename system config +handle_system() { + if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename system $1 system + fi +} +config_foreach handle_system system + +if [ -n "$(uci -q get meshwizard.system)" ]; then + echo " + Setup system" + uci show meshwizard.system | sed 's/^meshwizard/uci set system/g' | while read line; do + eval $line + echo " $line" + done + uci -q delete meshwizard.system +fi + +if [ -n "$(uci -q get meshwizard.community)" ]; then + echo " + Setup community" + uci show meshwizard.community | sed 's/^meshwizard/freifunk/g' | while read line; do + eval uci set $line + echo " $line" + done + uci -q delete meshwizard.community +fi + +if [ -n "$(uci -q get meshwizard.contact)" ]; then + echo " + Setup contact" + uci show meshwizard.contact | sed 's/^meshwizard/freifunk/g' | while read line; do + eval uci set $line + echo " $line" + done + uci -q delete meshwizard.contact +fi + +if [ -n "$(uci -q get meshwizard.luci_main)" ]; then + echo " + Setup luci" + uci show meshwizard.luci_main |sed -e 's/^meshwizard/luci/g' -e 's/luci_main/main/' | while read line; do + eval uci set $line + echo " $line" + done + uci -q delete meshwizard.luci_main +fi + +uci commit + + diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/ipcalc-cidr.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/ipcalc-cidr.sh new file mode 100755 index 000000000..39d051ec1 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/ipcalc-cidr.sh @@ -0,0 +1,41 @@ +#!/bin/sh +dir=$(dirname $0) +awk -f $dir/common.awk -f - $* <limit) end=limit + + print "IP="int2ip(ipaddr) + print "NETMASK="int2ip(netmask) + print "BROADCAST="int2ip(broadcast) + print "NETWORK="int2ip(network) + print "PREFIX="32-bitcount(compl(netmask)) + + # range calculations: + # ipcalc + + if (ARGC > 3) { + print "START="int2ip(start) + print "END="int2ip(end) + } +} +EOF 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 new file mode 100755 index 000000000..e20cc3827 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/read_defaults.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# This reads the settings we need to have to configure everything +# Argument $1: community + +community="$1" + +# reads variables from uci files, parameter $1 is the section +get_var() { + uci -q show $1 | cut -d "." -f 2-100 |grep "\." | sed -e 's/^\([a-z_]*\)\./\1_/g' -e 's/=\(.*\)$/="\1"/g' +} + +# read default values from /etc/config/freifunk +for v in system wifi_device wifi_iface interface alias dhcp olsr_interface olsr_interfacedefaults zone_freifunk include; do + get_var freifunk.$v +done + +# now read all values from the selected community profile, will override some values from the defaults before +for v in system wifi_device wifi_iface interface alias dhcp olsr_interface olsr_interfacedefaults profile zone_freifunk include; do + get_var profile_$community.$v +done 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 new file mode 100755 index 000000000..aee15f5b7 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/rename-wifi.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# This script renames IB_wifi_ interface names into real interface names used on this system. +# E.g. wireless.IB_wifi0 would become wireless.wifi0 on madwifi and wireless.radio0 on mac80211 + +posIB=-1 + +IBwifis="$(uci show meshwizard.netconfig | grep -v 'netconfig=netconfig' | sed 's/meshwizard.netconfig\.\(IB_wifi.*\)_.*/\1/' |uniq)" + +for w in $IBwifis; do + posIB=$(( $posIB + 1 )) + export IB_wifi$posIB="$w" +done + +pos=0 +syswifis="$(uci show wireless |grep wifi-device | sed 's/wireless\.\(.*\)=.*/\1/' |uniq)" + +for s in $syswifis; do + export syswifi$pos="$s" + pos=$(( $pos + 1 )) +done + +for i in `seq 0 $posIB`; do + IBwifi=$(eval echo \$IB_wifi$i) + syswifi=$(eval echo \$syswifi$i) + + if [ -n "$syswifi" ]; then + case $IBwifi in + IB_wifi* ) + # replace IB_wifi_* with actual wifi interface names, delete old ones first + 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") + uci set $newline + done + ;; + esac + unset IBwifi + unset syswifi + fi +done + +uci commit diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh new file mode 100755 index 000000000..4c7ea5afb --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# Sets up the dhcp part of dnsmasq + +. /etc/functions.sh +. $dir/functions.sh + +net="$1" + +handle_dnsmasq() { + config_get interface "$1" interface + if [ "$interface" == "${netrenamed}dhcp" ]; then + if [ "$cleanup" == 1 ]; then + section_cleanup dhcp.$1 + else + if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename dhcp $1 ${netrenamed}dhcp + fi + fi + fi +} +config_load dhcp +config_foreach handle_dnsmasq dhcp + +uci batch << EOF +set dhcp.${netrenamed}dhcp="dhcp" +set dhcp.${netrenamed}dhcp.leasetime="${dhcp_leasetime}" +set dhcp.${netrenamed}dhcp.force="1" +set dhcp.${netrenamed}dhcp.interface="${netrenamed}dhcp" +EOF + +echo " leasetime: ${dhcp_leasetime} + interface: ${netrenamed}dhcp" + diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh new file mode 100755 index 000000000..517b4fd34 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dnsmasq.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +. /etc/functions.sh +. $dir/functions.sh + +# Set dnsmasq config +handle_dhcp() { + if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename dhcp $1 dnsmasq + fi +} + +config_load dhcp +config_foreach handle_dhcp dnsmasq + +echo " + Setup dnsmasq" + +uci set dhcp.dnsmasq.local="/$profile_suffix/" +uci set dhcp.dnsmasq.domain="$profile_suffix" + +echo " local: /$profile_suffix/ + domain: $profile_suffix" + +config_get addnhosts dnsmasq addnhosts +if [ -z "${addnhosts/\var\/etc\/hosts.olsr/}" ]; then + uci add_list dhcp.dnsmasq.addnhosts="/var/etc/hosts.olsr" + echo " addnhosts: /var/etc/hosts.olsr" +fi + +uci commit + 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 new file mode 100755 index 000000000..8399aef93 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_firewall.sh @@ -0,0 +1,156 @@ +#!/bin/sh +# This will add $net to the zone firewall (and remove it from other zones where it is referenced) +# It will also setup rules defined in /etc/config/freifunk and /etc/config/profile_ +# Arg $1 = $net + +net=$1 +. /etc/functions.sh +. $dir/functions.sh +config_load firewall + +# Get some variables +type="$(uci -q get wireless.$net.type)" +vap="$(uci -q get meshwizard.netconfig.$net\_vap)" +lan_ip="$(uci -q get network.lan.ipaddr)" +lan_mask="$(uci -q get network.lan.netmask)" + +# Delete old firewall zone for freifunk +handle_fwzone() { + config_get name "$1" name + config_get network "$1" network + + if [ "$2" == "zoneconf" ]; then + # clean zone + if [ "$name" == "freifunk" ]; then + if [ "$cleanup" == 1 ]; then + section_cleanup firewall.$1 + else + # rename section if unnamed + if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename firewall $1 zone_freifunk + fi + fi + else + + if [ "$name" == "$netrenamed" ]; then + section_cleanup firewall.$1 + fi + if [ -n "$netrenamed" -a -n "$(echo $network | grep $netrenamed)" ] && [ ! "$name" == "freifunk" ]; then + echo " Removed $netrenamed from firewall zone $name." + network_new=$(echo $network | sed -e 's/'$netrenamed'//' -e 's/^ //' -e 's/ / /' -e 's/ $//') + uci set firewall.$1.network="$network_new" + fi + fi + else + # clean fw_rule, fw_forwarding, include and advanced + for option in src tcp_ecn path; do + config_get $option $1 $option + done + if [ "$src" == "freifunk" -o "$path" == "/etc/firewall.freifunk" -o -n "$tcpecn" ]; then + section_cleanup firewall.$1 + fi + fi +} + +config_foreach handle_fwzone zone zoneconf + +if [ "$cleanup" == 1 ]; then + for target in include advanced rule forwarding; do + config_foreach handle_fwzone $target + done +fi + +# setup freifunk firewall zone + +echo " + Setup firewall zone." + +# add $netrenamed and if needed ${netrenamed}dhcp to the networks for this zone +config_get network zone_freifunk network + +# remove ${netrenamed}dhcp from networks list +[ -n "$network" -a -n "$net" ] && network="${network/${netrenamed}dhcp/}" +network=$(echo $network) # Removes leading and trailing whitespaces + +[ -n "$netrenamed" ] && [ -z "$(echo $network | grep $netrenamed)" ] && network="$network $netrenamed" + +if [ "$type" == "atheros" -a "$vap" == 1 ]; then + [ -n "$netrenamed" ] && [ "$network" == "${network/${netrenamed}dhcp/}" ] && network="$network ${netrenamed}dhcp" +fi + +uci batch << EOF +set firewall.zone_freifunk="zone" +set firewall.zone_freifunk.name="freifunk" +set firewall.zone_freifunk.network="$network" +set firewall.zone_freifunk.input="$zone_freifunk_input" +set firewall.zone_freifunk.forward="$zone_freifunk_forward" +set firewall.zone_freifunk.output="$zone_freifunk_output" +EOF + +echo " network: $network + input: $zone_freifunk_input + forward: $zone_freifunk_forward + output: $zone_freifunk_output" + +# Usually we need to setup masquerading for lan, except lan is an olsr interface or has an olsr hna + +echo " + Setup masquerading rules" + +eval $(ipcalc.sh $lan_ip $lan_mask) + +handle_interface() { + config_get interface "$1" interface + if [ "$interface" == "lan" ]; then + no_masq_lan=1 + fi +} +config_load olsrd +config_foreach handle_interface Interface + +handle_hna() { + config_get netaddr "$1" netaddr + if [ "$NETWORK" == "$netaddr" ]; then + no_masq_lan=1 + fi +} +config_foreach handle_hna Hna4 + +currms=$(uci -q get firewall.zone_freifunk.masq_src) +if [ ! "$no_masq_lan" == "1" ]; then + uci set firewall.zone_freifunk.masq="1" && echo " Enabled masquerading." || echo -e "\033[1mWarning:\033[0m: Could not enable masquerading." + [ -z "$(echo $currms |grep $NETWORK/$PREFIX)" ] && uci add_list firewall.zone_freifunk.masq_src="$NETWORK/$PREFIX" +fi + +# If wifi-interfaces are outside of the mesh network they should be natted +for i in $networks; do + # Get dhcprange and meshnet + dhcprange=$(uci get meshwizard.netconfig.$i\_dhcprange) + meshnet="$(uci get profile_$community.profile.mesh_network)" + # check if the dhcprange is inside meshnet + dhcpinmesh="$($dir/helpers/check-range-in-range.sh $dhcprange $meshnet)" + if [ ! "$dhcpinmesh" == 1 ]; then + [ -z "$(echo $currms |grep $dhcprange)" ] && uci add_list firewall.zone_freifunk.masq_src="$dhcprange" + fi +done + +# Rules, Forwardings, advanced config and includes +# Clear firewall configuration + +echo " + Setup 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 + +uci commit diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh new file mode 100755 index 000000000..4f03d228c --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_network.sh @@ -0,0 +1,91 @@ +# setup entry in /etc/config/network for a interface +# Argument $1: network interface + +net="$1" +. /etc/functions.sh +. $dir/functions.sh + +# Delete the network interface section for $net +if [ "$cleanup" == 1 ]; then + section_cleanup network.$netrenamed +fi + +# Setup a (new) interface section for $net + +ipaddr=$(uci get meshwizard.netconfig.$net\_ip4addr) +[ -z "$ipaddr" ] && msg_missing_value meshwizard $net\_ip4addr + +[ -z "$interface_netmask" ] && interface netmask="255.255.0.0" + +uci batch << EOF +set network.$netrenamed="interface" +set network.$netrenamed.proto="static" +set network.$netrenamed.ipaddr="$ipaddr" +set network.$netrenamed.netmask="$interface_netmask" +set network.$netrenamed.dns="$interface_dns" +EOF + +echo " IP address: $ipaddr" +echo " Netmask : $interface_netmask" + +# setup dhcp alias/interface + +net_dhcp=$(uci -q get meshwizard.netconfig.${net}_dhcp) +if [ "$net_dhcp" == 1 ]; then + + # Load meshwizard_settings + dhcprange="$(uci -q get meshwizard.netconfig.${net}_dhcprange)" + interface_ip="$(uci -q get meshwizard.netconfig.${net}_ip4addr)" + vap=$(uci -q get meshwizard.netconfig.${net}_vap) + + # Clean/rename config + handle_dhcpalias() { + config_get interface "$1" interface + if [ "$interface" == "$netrenamed" ]; then + if [ "$cleanup" == 1 ]; then + section_cleanup network.$1 + else + if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename network $1 ${netrenamed}dhcp + fi + fi + fi + } + config_load network + config_foreach handle_dhcpalias alias + + # Get IP/netmask and start-ip for $net dhcp + # If no dhcprange is given in /etc/config/meshwizard we autogenerate one + + if [ -z "$dhcprange" ]; then + dhcprange="$($dir/helpers/gen_dhcp_ip.sh $interface_ip)/24" + uci set meshwizard.netconfig.${net}_dhcprange="$dhcprange" + fi + eval $(sh $dir/helpers/ipcalc-cidr.sh $dhcprange 1 0) + + # setup wifi-dhcp interface or alias + + # Setup alias for $net + + if [ "$vap" == 1 ]; then + echo " + Setup interface ${netrenamed}dhcp." + uci set network.${netrenamed}dhcp=interface + else + echo " + Setup alias interface ${netrenamed}dhcp." + uci set network.${netrenamed}dhcp=alias + uci set network.${netrenamed}dhcp.interface="$netrenamed" + fi + + uci batch << EOF +set network.${netrenamed}dhcp.proto=static +set network.${netrenamed}dhcp.ipaddr="$START" +set network.${netrenamed}dhcp.netmask="$NETMASK" +EOF + + echo " interface: $net + ipaddr: $START + netmask: $NETMASK" + +fi + +uci commit 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 new file mode 100755 index 000000000..d298828e3 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd.sh @@ -0,0 +1,126 @@ +#!/bin/sh +# Sets up olsrd +# arg $1 = net + +net=$1 + +. /etc/functions.sh + +. $dir/functions.sh + +# Clean or delete interface defaults +handle_interfacedefaults() { + if [ "$cleanup" == 1 ]; then + section_cleanup olsrd.$1 + else + if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename olsrd $1 InterfaceDefaults + fi + fi +} + +config_load olsrd +config_foreach handle_interfacedefaults InterfaceDefaults + +# Setup new InterfaceDefaults + +echo " + Setup InterfaceDefaults" +uci set olsrd.InterfaceDefaults=InterfaceDefaults +set_defaults "olsr_interfacedefaults_" olsrd.InterfaceDefaults + +# Delete old interface for $netrenamed +handle_interface() { + config_get interface "$1" Interface + if [ "$interface" == "$netrenamed" ]; then + if [ "$cleanup" == 1 ]; then + section_cleanup olsrd.$1 + elif [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename olsrd $1 $netrenamed + fi + fi +} + +config_foreach handle_interface Interface + +# Setup new interface for $netrenamed + +echo " + Setup Interface" + +uci set olsrd.$netrenamed=Interface + +set_defaults "olsr_interface_" olsrd.$net + +uci set olsrd.$netrenamed.interface="$netrenamed" +echo " interface: $netrenamed" + +# If dhcp-network is inside the mesh_network then add HNA for it +dhcprange=$(uci get meshwizard.netconfig.$net\_dhcprange) +meshnet="$(uci get profile_$community.profile.mesh_network)" + +uci -q delete olsrd.${netrenamed}clients + +# check if the dhcprange is inside meshnet +dhcpinmesh="$($dir/helpers/check-range-in-range.sh $dhcprange $meshnet)" + +if [ "$dhcpinmesh" == 1 ]; then + echo " + Setting up HNA" + uci set olsrd.${netrenamed}clients="Hna4" + eval $(sh $dir/helpers/ipcalc-cidr.sh $dhcprange) + uci set olsrd.${netrenamed}clients.netaddr="$NETWORK" + uci set olsrd.${netrenamed}clients.netmask="$NETMASK" + echo " netaddr: $NETWORK" + echo " natmask: $NETMASK" +fi + + +# Delete nameservice, dyngw and httpinfo plugins + +echo " + Configure Plugins" +handle_plugin() { + config_get library "$1" library + if [ "$cleanup" == 1 ]; then + case library in + olsrd_*) + section_cleanup olsrd.$1 + esac + elif [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + new="$(echo $library | cut -d '.' -f 1)" + section_rename olsrd $1 $new + fi +} +config_foreach handle_plugin LoadPlugin + +# Setup nameservice plugin +if [ -n "$profile_suffix" ]; then + suffix=".$profile_suffix" +else + suffix=".olsr" +fi +uci batch << EOF +set olsrd.olsrd_nameservice=LoadPlugin +set olsrd.olsrd_nameservice.library="olsrd_nameservice.so.0.3" +set olsrd.olsrd_nameservice.latlon_file="/var/run/latlon.js" +set olsrd.olsrd_nameservice.hosts_file="/var/etc/hosts.olsr" +set olsrd.olsrd_nameservice.sighup_pid_file="/var/run/dnsmasq.pid" +set olsrd.olsrd_nameservice.suffix="$suffix" +EOF + +echo " Nameservice Plugin configured." + +# Setup dyngw_plain + +# If Sharing of Internet is enabled then enable dyngw_plain plugin +sharenet=$(uci -q get meshwizard.general.sharenet) + +if [ -n "$(uci -q get olsrd.dyngw_plain.library)" ]; then + section_cleanup olsrd.dyngw_plain +fi + +if [ "$sharenet" == 1 ]; then + echo " + Setup dyngw_plain" + uci set olsrd.dyngw_plain=LoadPlugin + uci set olsrd.dyngw_plain.ignore=0 + uci set olsrd.dyngw_plain.library="olsrd_dyn_gw_plain.so.0.4" +fi + +uci commit diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh new file mode 100755 index 000000000..8e143d338 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_splash.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# Setup_splash, takes 1 argument: 1=net + +. /etc/functions.sh +. $dir/functions.sh + +net=$1 + +handle_splash() { + config_get network "$1" network + if [ "$network" == "${netrenamed}dhcp" ]; then + if [ "$cleanup" == 1 ]; then + section_cleanup luci_splash.$1 + else + if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename luci_splash $1 ${netrenamed}dhcp + fi + fi + fi +} +config_load luci_splash +config_foreach handle_splash iface + +uci batch << EOF +set luci_splash.${netrenamed}dhcp="iface" +set luci_splash.${netrenamed}dhcp.network="${net}dhcp" +set luci_splash.${netrenamed}dhcp.zone="freifunk" +EOF + +echo " network: ${netrenamed}dhcp" + +uci commit \ No newline at end of file diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh new file mode 100755 index 000000000..150e412de --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh @@ -0,0 +1,107 @@ +#!/bin/sh +# sets up a wifi interface for meshing +# Arguments: $1 = network interface + +net="$1" +. /etc/functions.sh +. $dir/functions.sh + +##### wifi-device ##### + +echo " + Setup wifi-device" + +# Get the type before we delete the wifi-device +config_load wireless +config_get type $net type + +# Delete old wifi-device for $net + +handle_wifidevice() { + if [ "$1" == "$net" -a "$cleanup" == 1 ]; then + section_cleanup wireless.${net} + else + if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename wireless $1 $net + fi + fi +} +config_foreach handle_wifidevice wifi-device + +# create new wifi-device for $net +uci set wireless.${net}=wifi-device + +# get and set wifi-device defaults +set_defaults "wifi_device_" wireless.${net} + +channel="$(uci -q get meshwizard.netconfig.$net\_channel)" +vap="$(uci -q get meshwizard.netconfig.$net\_vap)" + +if [ -z "$channel" -o "$channel" == "default" ]; then + channel=$wifi_device_channel +fi + +uci batch << EOF +set wireless.${net}.type="$type" +set wireless.${net}.channel="$channel" +EOF + +echo " Type: $type" +echo " Channel: $channel" + +##### wifi iface + +echo " + Setup wifi-iface" + +# Delete old wifi-iface for $net +handle_interface() { + config_get device "$1" device + if [ "$device" == "$net" ]; then + if [ "$cleanup" == 1 ]; then + section_cleanup wireless.${net}_iface + else + if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then + section_rename wireless $1 ${net}_iface + fi + fi + fi +} +config_foreach handle_interface wifi-iface + +# create new wifi-device for $net +uci set wireless.$net\_iface=wifi-iface + +# create new wifi-iface for $net from defaults +set_defaults "wifi_iface_" wireless.$net\_iface + +# overwrite defaults +bssid="$($dir/helpers/gen_bssid.sh $channel $community)" +uci batch << EOF +set wireless.$net\_iface.device="${net}" +set wireless.$net\_iface.network="$netrenamed" +set wireless.$net\_iface.ssid="$profile_ssid - ch$channel" +set wireless.$net\_iface.bssid="$bssid" +EOF + +echo " device: $net + network: $netrenamed + ssid: $profile_ssid - ch$channel + bssid: $bssid" + +## VAP +ip4addr="$(uci get meshwizard.netconfig.$net\_ip4addr)" +if [ "$type" == "atheros" -a "$vap" == 1 ]; then + uci batch << EOF +set wireless.$net\_iface_dhcp="wifi-iface" +set wireless.$net\_iface_dhcp.device="$net" +set wireless.$net\_iface_dhcp.mode="ap" +set wireless.$net\_iface_dhcp.encryption="none" +set wireless.$net\_iface_dhcp.network="${netrenamed}dhcp" +set wireless.$net\_iface_dhcp.ssid="FF-AP-$ip4addr" +EOF + echo " + Setting up VAP interface for $net + device: $net + network: ${netrenamed}dhcp + ssid: AP-$profile_ssid-$ip4addr" +fi + +uci commit diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh new file mode 100755 index 000000000..56be8bc71 --- /dev/null +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/wizard.sh @@ -0,0 +1,96 @@ +#!/bin/sh +# This script will take settings from /etc/config/meshwizard, /etc/config/freifunk and /etc/config/profile_ +# and setup the router to participate in wireless mesh networks + +. /etc/functions.sh + +# config +export dir="/usr/bin/meshwizard" +. $dir/functions.sh +debug=1 + +# Rename wifi interfaces + echo "++++ Renaming wifi-devices in /etc/config/meshwizard" + $dir/helpers/rename-wifi.sh + +# Firstboot/initial config + echo "++++ Initial config" + $dir/helpers/initial_config.sh + +# Get community +export community=$(uci get freifunk.community.name) +[ -z "$community" ] && echo "Error: Community is not set in /etc/config/freifunk, aborting now." && exit 1 + +# Check whether we want to cleanup uci config before setting new options or not +cleanup=$(uci -q get meshwizard.general.cleanup) + +[ "$cleanup" == 1 ] && export cleanup=1 + +# 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 + +echo "+++ wizard 0.0.1 +++ +Community=$community +Network(s)=$networks" + +# Read default values (first from /etc/config/freifunk, then from /etc/config/profile_$community, +# last will overwrite first + + +$dir/helpers/read_defaults.sh $community > /tmp/meshwizard.tmp +while read line; do + export "${line//\"/}" +done < /tmp/meshwizard.tmp + +# dnsmasq + echo "++++ dnsmasq config" + $dir/helpers/setup_dnsmasq.sh + +# Configure found networks +for net in $networks; do + + netrenamed="${net/radio/wireless}" + export netrenamed + + echo "++++ Configure interface $net" + + config="network" + echo "$(msg_start $config)" + $dir/helpers/setup_network.sh $net + + config="wireless" + echo "$(msg_start $config)" + $dir/helpers/setup_wifi.sh $net + + config="OLSRd" + echo "$(msg_start $config)" + $dir/helpers/setup_olsrd.sh $net + + net_dhcp=$(uci -q get meshwizard.netconfig.${net}_dhcp) + if [ "$net_dhcp" == 1 ]; then + config="DHCP" + echo "$(msg_start $config)" + $dir/helpers/setup_dhcp.sh $net + fi + + config="luci_splash" + echo "$(msg_start $config)" + $dir/helpers/setup_splash.sh $net + + config="firewall" + echo "$(msg_start $config)" + $dir/helpers/setup_firewall.sh $net + + echo " Configuration of $net finished." +done + +##### Restart services +services="network olsrd dnsmasq luci_splash" +echo " Restarting services:" +for s in $services; do + /etc/init.d/$s restart >/dev/null 2>&1 + echo " * $s" +done diff --git a/modules/freifunk/root/etc/config/freifunk b/modules/freifunk/root/etc/config/freifunk index 9aa3f27c3..e69662cbb 100644 --- a/modules/freifunk/root/etc/config/freifunk +++ b/modules/freifunk/root/etc/config/freifunk @@ -1,7 +1,5 @@ package 'freifunk' -config 'settings' 'wizard' - config 'public' 'contact' option 'nickname' '' option 'name' '' @@ -14,45 +12,75 @@ config 'public' 'community' option 'name' 'Freifunk' option 'homepage' 'http://freifunk.net' -config 'fw_rule' 'icmp' +config 'fw_zone' 'zone_freifunk' + option 'name' 'freifunk' + option 'input' 'REJECT' + option 'forward' 'REJECT' + option 'output' 'ACCEPT' + +config 'fw_rule' 'fficmp' option 'src' 'freifunk' option 'target' 'ACCEPT' option 'proto' 'icmp' -config 'fw_rule' 'http' +config 'fw_rule' 'ffhttp' option 'src' 'freifunk' option 'target' 'ACCEPT' option 'proto' 'tcp' option 'dest_port' '80' -config 'fw_rule' 'https' +config 'fw_rule' 'ffhttps' option 'src' 'freifunk' option 'target' 'ACCEPT' option 'proto' 'tcp' option 'dest_port' '443' -config 'fw_rule' 'ssh' +config 'fw_rule' 'ffssh' option 'src' 'freifunk' option 'target' 'ACCEPT' option 'proto' 'tcp' option 'dest_port' '22' -config 'fw_rule' 'olsr' +config 'fw_rule' 'ffolsr' option 'src' 'freifunk' option 'target' 'ACCEPT' option 'proto' 'udp' option 'dest_port' '698' -config 'fw_rule' 'wprobe' +config 'fw_rule' 'ffwprobe' option 'src' 'freifunk' option 'target' 'ACCEPT' option 'proto' 'tcp' option 'dest_port' '17990' -config 'fw_forwarding' 'lan' +config 'fw_rule' 'ffdns' + option 'dest_port' '53' + option 'src' 'freifunk' + option 'target' 'ACCEPT' + option 'proto' 'udp' + +config 'fw_rule' 'ffdhcp' + option 'src_port' '68' + option 'src' 'freifunk' + option 'target' 'ACCEPT' + option 'dest_port' '67' + option 'proto' 'udp' + option 'leasetime' '30m' + +config 'fw_rule' 'ffsplash' + option 'dest_port' '8082' + option 'src' 'freifunk' + option 'target' 'ACCEPT' + option 'proto' 'tcp' + +config 'fw_forwarding' 'lanfffwd' option 'src' 'lan' option 'dest' 'freifunk' +config 'fw_forwarding' 'ffwanfwd' + option 'src' 'freifunk' + option 'dest' 'wan' + config 'fw_forwarding' 'fffwd' option 'src' 'freifunk' option 'dest' 'freifunk' @@ -61,13 +89,18 @@ config 'defaults' 'wifi_device' option 'channel' '1' option 'diversity' '1' option 'disabled' '0' - option 'txpower' '15' - option 'country' '276' + option 'country' 'DE' + option 'hwmode' '11g' + option 'distance' '1000' config 'defaults' 'wifi_iface' option 'mode' 'adhoc' - option 'bssid' '02:CA:FF:EE:BA:BE' + option 'encryption' 'none' + option 'bgscan' '0' + option 'bssid' '12:CA:FF:EE:BA:BE' option 'sw_merge' '1' + option 'mcast_rate' '5500' + option 'probereq' '1' config 'defaults' 'interface' option 'netmask' '255.255.0.0' @@ -79,9 +112,10 @@ config 'defaults' 'alias' config 'defaults' 'dhcp' option 'leasetime' '30m' -config 'defaults' 'olsr_interface' +config 'defaults' 'olsr_interfacedefaults' option 'Ip4Broadcast' '255.255.255.255' config 'defaults' 'upgrade' option 'repository' 'http://dev.luci.freifunk-halle.net/freifunk-snapshots' option 'rssfeed' 'http://firmware.leipzig.freifunk.net/kamikaze/.rss.xml' + diff --git a/modules/freifunk/root/etc/config/profile_-custom b/modules/freifunk/root/etc/config/profile_-custom deleted file mode 100644 index 6335be48f..000000000 --- a/modules/freifunk/root/etc/config/profile_-custom +++ /dev/null @@ -1,10 +0,0 @@ -config 'community' 'profile' - option 'name' 'Custom' - option 'homepage' 'http://example.freifunk.net' - option 'ssid' 'example.freifunk.net' - option 'splash_network' '10.104.0.0/16' - option 'latitude' '52.000' - option 'longitude' '10.000' - option 'splash_prefix' '28' - option 'mesh_network' '1.0.0.0/16' - diff --git a/modules/freifunk/root/etc/config/profile_Freifunk b/modules/freifunk/root/etc/config/profile_Freifunk new file mode 100644 index 000000000..b8f445a73 --- /dev/null +++ b/modules/freifunk/root/etc/config/profile_Freifunk @@ -0,0 +1,10 @@ +config 'community' 'profile' + option 'name' 'Freifunk' + option 'homepage' 'http://freifunk.net' + option 'ssid' 'www.freifunk.net' + option 'splash_network' '10.104.0.0/16' + option 'latitude' '52.000' + option 'longitude' '10.000' + option 'splash_prefix' '28' + option 'mesh_network' '10.0.0.0/8' + diff --git a/modules/freifunk/root/etc/config/profile_augsburg b/modules/freifunk/root/etc/config/profile_augsburg index fd5cdda59..d31558585 100644 --- a/modules/freifunk/root/etc/config/profile_augsburg +++ b/modules/freifunk/root/etc/config/profile_augsburg @@ -12,3 +12,7 @@ config 'community' 'profile' config 'defaults' 'interface' option 'netmask' '255.255.192.0' +config 'defaults' 'bssidscheme' + option '1' '02:CA:FF:EE:BA:BE' + option '13' '13:CA:FF:EE:BA:BE' + diff --git a/po/ca/meshwizard.po b/po/ca/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/ca/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/de/meshwizard.po b/po/de/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/de/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/el/meshwizard.po b/po/el/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/el/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/en/meshwizard.po b/po/en/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/en/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/es/meshwizard.po b/po/es/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/es/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/fr/meshwizard.po b/po/fr/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/fr/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/it/meshwizard.po b/po/it/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/it/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/ja/meshwizard.po b/po/ja/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/ja/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/ms/meshwizard.po b/po/ms/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/ms/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/no/meshwizard.po b/po/no/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/no/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/pl/meshwizard.po b/po/pl/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/pl/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/pt/meshwizard.po b/po/pt/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/pt/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/pt_BR/meshwizard.po b/po/pt_BR/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/pt_BR/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/ru/meshwizard.po b/po/ru/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/ru/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/templates/meshwizard.pot b/po/templates/meshwizard.pot new file mode 100644 index 000000000..fe7464e65 --- /dev/null +++ b/po/templates/meshwizard.pot @@ -0,0 +1,84 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8" + +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/vi/meshwizard.po b/po/vi/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/vi/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" diff --git a/po/zh_CN/meshwizard.po b/po/zh_CN/meshwizard.po new file mode 100644 index 000000000..f035cf46d --- /dev/null +++ b/po/zh_CN/meshwizard.po @@ -0,0 +1,81 @@ +msgid "Channel" +msgstr "" + +msgid "Check this to protect your LAN from other nodes or clients" +msgstr "" + +msgid "Cleanup config" +msgstr "" + +msgid "Configure this interface" +msgstr "" + +msgid "DHCP IP range" +msgstr "" + +msgid "DHCP will automatically assign ip addresses to clients" +msgstr "" + +msgid "Enable DHCP" +msgstr "" + +msgid "General Settings" +msgstr "" + +msgid "" +"If this is selected then config is cleaned before setting new config options." +msgstr "" + +msgid "Interfaces" +msgstr "" + +msgid "Mesh IP address" +msgstr "" + +msgid "Mesh Wizard" +msgstr "" + +msgid "Protect LAN" +msgstr "" + +msgid "" +"Select this to allow others to use your connection to access the internet." +msgstr "" + +msgid "Share your internet connection" +msgstr "" + +msgid "" +"The IP range from which clients are assigned ip addresses (e.g. " +"10.1.2.1/28). If this is a range inside your mesh network range, then it " +"will be announced as HNA. Any other range will use NAT. If left empty then " +"the defaults from the community profile will be used." +msgstr "" + +msgid "The given IP address is not inside the mesh network range" +msgstr "" + +msgid "" +"This is a unique address in the mesh (e.g. 10.1.1.1) and has to be " +"registered at your local community." +msgstr "" + +msgid "This will setup a new virtual wireless interface in Access Point mode." +msgstr "" + +msgid "" +"This wizard will assist you in setting up your router for Freifunk or " +"another similar wireless community network." +msgstr "" + +msgid "Virtual Access Point (VAP)" +msgstr "" + +msgid "Wizard" +msgstr "" + +msgid "Your device and neighbouring nodes have to use the same channel." +msgstr "" + +msgid "recommended" +msgstr "" -- cgit v1.2.3