set ucitrack.meshwizard.exec="/etc/init.d/wizard boot"
commit ucitrack
EOF
+
+rm -f /tmp/luci-indexcache
echo -en "Cache-Control: no-cache, max-age=0, no-store, must-revalidate\r\n"
echo -en "Pragma: no-cache\r\n"
echo -en "Expires: -1\r\n"
-echo -en "Status: 403 Forbidden\r\n"
-echo -en "Content-Type: text/html\r\n\r\n"
-#echo -en "Status: 307 Temporary Redirect\r\n"
-#echo -en "Location: http://$SERVER_ADDR/cgi-bin/luci/splash\r\n\r\n"
+echo -en "Status: 307 Temporary Redirect\r\n"
+echo -en "Location: http://$SERVER_ADDR/cgi-bin/luci/splash\r\n"
+echo -en "\r\n"
cat <<EOT
-<html>
- <head>
- <title>Splash</title>
- <meta http-equiv="refresh" content="0; url=http://$SERVER_ADDR/cgi-bin/luci/splash" />
- </head>
- <body style="font-family:sans-serif">
- <h1>Splash on $(cat /proc/sys/kernel/hostname)</h1>
- <p>
- Redirecting to authentication for $REMOTE_ADDR on $SERVER_ADDR.<br /><br />
- [<a href="http://$SERVER_ADDR/cgi-bin/luci/splash">Click here to continue...</a>]
- </p>
- </body>
-</html>
+<?xml version="1.0" encoding="UTF-8"?>
+<WISPAccessGatewayParam xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.wballiance.net/wispr_2_0.xsd">
+ <Redirect>
+ <MessageType>100</MessageType>
+ <ResponseCode>0</ResponseCode>
+ <AccessProcedure>1.0</AccessProcedure>
+ <AccessLocation>12</AccessLocation>
+ <LocationName>$SERVER_ADDR</LocationName>
+ <LoginURL>http://$SERVER_ADDR/cgi-bin/luci/splash?wispr=1</LoginURL>
+ <AbortLoginURL>http://$SERVER_ADDR/</AbortLoginURL>
+ </Redirect>
+</WISPAccessGatewayParam>
EOT
}
start() {
- lock -w $LOCK && lock $LOCK
+ lock $LOCK
include /lib/network
scan_interfaces
}
stop() {
- lock -w $LOCK && lock $LOCK
+ lock $LOCK
include /lib/network
scan_interfaces
local limit_down = 0
function lock()
- os.execute("lock -w /var/run/luci_splash.lock && lock /var/run/luci_splash.lock")
+ os.execute("lock /var/run/luci_splash.lock")
end
function unlock()
type="$(uci -q get wireless.$net.type)"
vap="$(uci -q get meshwizard.netconfig.$net\_vap)"
+# Add local_restrict to wan firewall zone
+handle_zonewan() {
+ config_get name "$1" name
+ if [ "$name" == "wan" ]; then
+ uci set firewall.$1.local_restrict=1
+ fi
+}
+config_foreach handle_zonewan zone && echo " + Enable local_restrict for zone wan"
+
# Delete old firewall zone for freifunk
handle_fwzone() {
config_get name "$1" name
uci batch << EOF
set luci_splash.${netrenamed}dhcp="iface"
-set luci_splash.${netrenamed}dhcp.network="${net}dhcp"
+set luci_splash.${netrenamed}dhcp.network="${netrenamed}dhcp"
set luci_splash.${netrenamed}dhcp.zone="freifunk"
EOF
echo " network: ${netrenamed}dhcp"
-uci commit
\ No newline at end of file
+uci commit
+
+/etc/init.d/luci_splash enable
+
--- /dev/null
+#!/bin/sh
+# Sets values from /etc/config/freifunk and/or the community profile in /etc/config/system
+
+if [ -n "$(env | grep '^system_')" ]; then
+ echo "++++ Setup system"
+ env | grep "^system_" | sed "s/system_/uci set system.system./g" | while read line; do
+ eval $line
+ echo " $line"
+ done
+fi
+
+uci commit system
[ -z "$networks" ] && echo "Error: No networks to setup could be found in /etc/config/meshwizard, aborting now." && exit 1
-echo "+++ wizard 0.0.1 +++
+echo "+++ wizard 0.0.2 +++
Community=$community
Network(s)=$networks"
echo "++++ dnsmasq config"
$dir/helpers/setup_dnsmasq.sh
+# system
+ $dir/helpers/setup_system.sh
+
# Configure found networks
for net in $networks; do
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
+##### Reboot the router (because simply restarting services gave errors)
reboot
if has_dnsmasq and net:proto() == "static" then
m2 = Map("dhcp", "", "")
- local section_id = "-"
-
+ local section_id
function m2.on_parse()
m2.uci:foreach("dhcp", "dhcp", function(s)
if s.interface == arg[1] then
return false
end
end)
+
+ if not section_id then
+ local c = 1
+ section_id = arg[1]
+ while m2.uci:get("dhcp", section_id) do
+ section_id = arg[1] .. c
+ c = c + 1
+ end
+ end
end
s = m2:section(TypedSection, "dhcp", translate("DHCP Server"))
"this interface."))
ignore.rmempty = false
-
- function ignore.cfgvalue(self, section)
- return (section == "-") and self.enabled or Flag.cfgvalue(self, section)
- end
+ ignore.default = ignore.enabled
function ignore.write(self, section, value)
- section_id = m2.uci:section("dhcp", "dhcp", nil, {
- ignore = value,
- interface = arg[1]
- })
- end
+ if m2.uci:get("dhcp", section) ~= "dhcp" then
+ m2.uci:section("dhcp", "dhcp", section, {
+ interface = arg[1]
+ })
+ end
+ m2.uci:set("dhcp", section, "ignore", (value == "1") and "1" or "0")
+ end
local start = s:taboption("general", Value, "start", translate("Start"),
"192.168.2.2</code>\" which advertises different DNS servers to clients."))
- local function write_opt(self, section, value)
- return getmetatable(self).__index.write(self, section_id, value)
- end
-
- local function remove_opt(self, section, value)
- return getmetatable(self).__index.remove(self, section_id, value)
- end
-
for i, n in ipairs(s.children) do
if n ~= ignore then
n:depends("ignore", "")
- n.write = write_opt
- n.remove = remove_opt
end
end
end
o.datatype = "port"
o = s:taboption("logging", ListValue, "conloglevel", translate("Log output level"))
-o:value(7, translate("Debug"))
-o:value(6, translate("Info"))
-o:value(5, translate("Notice"))
-o:value(4, translate("Warning"))
-o:value(3, translate("Error"))
-o:value(2, translate("Critical"))
-o:value(1, translate("Alert"))
-o:value(0, translate("Emergency"))
+o:value(8, translate("Debug"))
+o:value(7, translate("Info"))
+o:value(6, translate("Notice"))
+o:value(5, translate("Warning"))
+o:value(4, translate("Error"))
+o:value(3, translate("Critical"))
+o:value(2, translate("Alert"))
+o:value(1, translate("Emergency"))
o = s:taboption("logging", ListValue, "cronloglevel", translate("Cron Log Level"))
o.default = 8
tr.insertCell(-1).innerHTML = String.format('%d dBm', assoclist[i].noise);
}
- if (ac.rows.length == 0)
+ if (ac.rows.length == 1)
{
var tr = ac.rows[0].parentNode.insertRow(-1);
tr.className = 'cbi-section-table-row';
' '..
luci.sys.hostname()..
'. '..
- translate("It is operated by ")..
- '<a href="'..
+ translate("It is operated by")..
+ ' <a href="'..
luci.dispatcher.build_url("freifunk", "index", "contact")..
'">'..
(ff.contact.nickname or translate("Please set your contact information"))..
option 'src' 'freifunk'
option 'dest' 'freifunk'
+config 'defaults' 'system'
+ option 'zonename' 'Europe/Berlin'
+ option 'timezone' 'CET-1CEST,M3.5.0,M10.5.0/3'
+
config 'defaults' 'wifi_device'
option 'channel' '1'
option 'diversity' '1'
config 'defaults' 'interface'
option 'netmask' '255.0.0.0'
-
+config 'defaults' 'bssidscheme'
+ option '1' '02:CA:FF:EE:BA:BE'
option 'splash_prefix' '27'
option 'latitude' '52.26337'
option 'longitude' '10.52103'
+
+config 'defaults' 'bssidscheme'
+ option '1' '02:CA:FF:EE:BA:BE'
option 'longitude' '12.40297'
-
+config 'defaults' 'bssidscheme'
+ option '1' '02:CA:FF:EE:BA:BE'
done
}
- ( /usr/sbin/ff_rdate; /etc/init.d/cron restart ) &
+ ( sleep 40; /usr/sbin/ff_rdate; /etc/init.d/cron restart ) &
}
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-06-10 03:40+0200\n"
-"PO-Revision-Date: 2011-05-22 10:50+0200\n"
+"PO-Revision-Date: 2011-06-26 16:20+0200\n"
"Last-Translator: Massimo <coatto87@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Pootle 2.0.4\n"
msgstr "15 minuti carico::"
msgid "40MHz 2nd channel above"
-msgstr "40MHz secondo canale insieme"
+msgstr "40MHz superiore"
msgid "40MHz 2nd channel below"
-msgstr "40MHz per il secondo canale "
+msgstr "40MHz inferiore"
msgid "5 Minute Load:"
msgstr "5 minuti carico:"
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"PO-Revision-Date: 2011-06-20 14:49+0200\n"
-"Last-Translator: Alex <gaus@pisem.net>\n"
+"PO-Revision-Date: 2011-07-01 12:49+0200\n"
+"Last-Translator: Jo-Philipp <xm@subsignal.org>\n"
"Language-Team: none\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
msgstr ""
msgid "Announced DNS servers"
-msgstr ""
+msgstr "Объявленные DNS сервера"
msgid "Announced NTP servers"
-msgstr ""
+msgstr "Объявленные NTP сервера "
msgid "Announced prefixes"
msgstr ""
msgstr "Сбор данных.."
msgid "Forwarder"
-msgstr ""
+msgstr "Средство передачи"
msgid "General Setup"
msgstr ""
}
#maincontent{
- font-size:35px!important;
+ font-size:25px!important;
line-height:40px;
}
float:none !important;
padding:10px 30px !important;
margin: 0px 10px !important;
- font-size:45px !important;
+ font-size:25px !important;
font-family: impact, sans-serif !important;
background:#ff8800 none !important;
border-color:#000000 !important;
.cbi-input-user,
.cbi-input-password{
display:block !important;
- font-size:35px !important;
+ font-size:25px !important;
margin: 0 !important;
padding:0 !important;
}
.cbi-value-field{
- font-size:35px;
+ font-size:25px;
margin:0 !important;
margin-bottom: 1em !important;
width:100% !important;
}
.cbi-value-title{
- font-size:35px;
+ font-size:25px;
font-weight:bold;
float:none !important;
}