#!/bin/sh
uci batch <<-EOF
- set freifunk.community.name='Freifunk Halle'
- set freifunk.community.homepage=http://halle.freifunk.net
- set freifunk.community.realm=pool.freifunk-halle.net
- set freifunk.wifi_iface.ssid=halle.freifunk.net
set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de
- commit freifunk
commit luci
EOF
#!/bin/sh
uci batch <<-EOF
- set freifunk.community.name='Freifunk Leipzig'
- set freifunk.community.homepage=http://leipzig.freifunk.net
- set freifunk.community.realm=db.leipzig.freifunk.net
- set freifunk.wifi_iface.ssid=leipzig.freifunk.net
set luci.main.mediaurlbase=/luci-static/fledermaus
set luci.main.lang=de
- commit freifunk
commit luci
EOF
\ No newline at end of file
net = f:field(Value, "net", "Freifunknetz")
net.rmempty = true
net:depends("wifi", "1")
-net:value("104.0", "Berlin (104.0)")
-net:value("104.59", "Leisnig/Gadow/div. (104.59)")
-net:value("104.61", "Leipzig (104.61)")
-net:value("104.62", "Halle (104.62)")
-net:value("191.161", "Augsburg (191.161)")
+uci:foreach("freifunk", "community", function(s)
+ net:value(s[".name"], s.name)
+end)
function net.cfgvalue(self, section)
return uci:get("freifunk", "wizard", "net")
end
-subnet = f:field(ListValue, "subnet", "Subnetz (Projekt)")
+subnet = f:field(Value, "subnet", "Subnetz (Projekt)")
subnet.rmempty = true
subnet:depends("wifi", "1")
-for i=0, 255 do
- subnet:value(i)
-end
function subnet.cfgvalue(self, section)
return uci:get("freifunk", "wizard", "subnet")
end
end
local device = dev:formvalue(section)
+ local community
-- Collect IP-Address
local inet = net:formvalue(section)
-- Invalidate fields
if not inet then
net.tag_missing[section] = true
+ else
+ community = inet
+ inet = uci:get("freifunk", community, "prefix") or inet
end
if not isubnet then
subnet.tag_missing[section] = true
-- Cleanup
- luci.util.perror("1")
tools.wifi_delete_ifaces(device)
- luci.util.perror("2")
tools.network_remove_interface(device)
- luci.util.perror("3")
tools.firewall_zone_remove_interface("freifunk", device)
-
+
+ -- Tune community settings
+ if community then
+ uci:tset("freifunk", "community", uci:get_all("freifunk", community))
+ end
-- Tune wifi device
local devconfig = _strip_internals(uci:get_all("freifunk", "wifi_device"))
local ifconfig = _strip_internals(uci:get_all("freifunk", "wifi_iface"))
ifconfig.device = device
ifconfig.network = device
+ ifconfig.ssid = uci:get("freifunk", community, "ssid")
uci:section("wireless", "wifi-iface", nil, ifconfig)
-- Save wifi
if not inet or not isubnet or not inode then
return
end
+
+ inet = uci:get("freifunk", inet, "prefix") or inet
local dhcpbeg = 48 + tonumber(inode) * 4
local dclient = "%s.%s.%s" % {inet:gsub("^[0-9]+", "10"), isubnet, dhcpbeg}
uci:section("dhcp", "dhcp", device .. "dhcp", dhcpbase)
uci:save("dhcp")
+
+ uci:delete_all("firewall", "rule", {
+ src="freifunk",
+ proto="udp",
+ src_port="68",
+ dest_port="67"
+ })
+ uci:section("firewall", "rule", nil, {
+ src="freifunk",
+ proto="udp",
+ src_port="68",
+ dest_port="67",
+ target="ACCEPT"
+ })
+
-- Delete old splash
config 'LoadPlugin'
option 'library' 'olsrd_nameservice.so.0.3'
option 'name' 'luci-node.olsr'
+ option 'latlon_file' '/dev/null'
config 'LoadPlugin'
option 'library' 'olsrd_txtinfo.so.0.1'
c:option(Value, "mail", translate("mail"), translate("mail1"))
c:option(Value, "phone", translate("phone"))
c:option(Value, "location", translate("location"))
-c:option(Value, "geo", translate("coord"), translate("coord1"))
c:option(Value, "note", translate("note"))
-return m
\ No newline at end of file
+m2 = Map("system", translate("geo"))
+
+s = m2:section(TypedSection, "system", "")
+s:option(Value, "latitude", translate("latitude", "Breite")).rmempty = true
+s:option(Value, "longitude", translate("longitude", "Länge")).rmempty = true
+
+return m, m2
\ No newline at end of file
des Routers aus, sondern definieren nur die Vorgaben für den Freifunkassistenten.]])
c:option(Value, "name", "Gemeinschaft")
c:option(Value, "homepage", "Webseite")
-c:option(Value, "realm", "Realm")
+c:option(Value, "ssid", "ESSID")
+c:option(Value, "prefix", "Netzprefix")
return m
\ No newline at end of file
+config settings wizard
config public contact
- option nickname
- option name
- option mail
- option phone
- option location
- option geo
- option note
+ option nickname ''
+ option name ''
+ option mail ''
+ option phone ''
+ option location ''
+ option note ''
config public community
- option name "Freifunk Halle"
- option homepage http://halle.freifunk.net
- option realm netz.freifunk-halle.net
-
-config settings wizard
-
+ option name 'Freifunk'
+ option homepage 'http://freifunk.net'
config fw_rule http
option src freifunk
option target ACCEPT
option proto tcp
option dest_port 80
-
+
config fw_rule https
option src freifunk
option target ACCEPT
option proto tcp
option dest_port 443
-
+
config fw_rule ssh
option src freifunk
option target ACCEPT
option target ACCEPT
option proto udp
option dest_port 698
-
+
config fw_forwarding lan
option src lan
option dest freifunk
-
config defaults wifi_device
option channel 1
option rxant 1
option diversity 0
option disabled 0
-
+
config defaults wifi_iface
option mode adhoc
- option ssid halle.freifunk.net
option bssid 02:CA:FF:EE:BA:BE
option txpower 10
option rts 2347
option frag 512
-
-
+
+
config defaults interface
option netmask 255.0.0.0
option dns "88.198.178.18 141.54.1.1 212.204.49.83 208.67.220.220 208.67.222.222"
config defaults alias
option netmask 255.255.255.0
-
-
+
+
config defaults dhcp
option leasetime 30m
-
-
+
+
config defaults olsr_interface
option HelloInterval 6.0
option HelloValidityTime 108.0
option MidInterval 18.0
option MidValidityTime 324.0
option HnaInterval 18.0
- option HnaValidityTime 108.0
\ No newline at end of file
+ option HnaValidityTime 108.0
+
+
+config community leipzig
+ option name "Freifunk Leipzig (104.61)"
+ option homepage http://leipzig.freifunk.net
+ option ssid "leipzig.freifunk.net"
+ option prefix "104.61"
+
+config community halle
+ option name "Freifunk Halle (104.62)"
+ option homepage http://halle.freifunk.net
+ option ssid "halle.freifunk.net"
+ option prefix "104.62"
+
+config community l59
+ option name "Leisnig, Gadow, ... (104.59)"
+ option homepage http://freifunk.net
+ option ssid "start.freifunk.net"
+ option prefix "104.59"
+
+config community berlin
+ option name "Freifunk Berlin (104)"
+ option homepage http://berlin.freifunk.net
+ option ssid "olsr.freifunk.net"
+ option prefix "104"
+
+config community augsburg
+ option name "Freifunk Augsburg (191.161)"
+ option homepage http://augsburg.freifunk.net
+ option ssid "augsburg.freifunk.net"
+ option prefix "191.161"
\ No newline at end of file