* modules/freifunk: Cleaned up Freifunk init-Script and wizard
authorSteven Barth <steven@midlink.org>
Wed, 14 May 2008 19:41:40 +0000 (19:41 +0000)
committerSteven Barth <steven@midlink.org>
Wed, 14 May 2008 19:41:40 +0000 (19:41 +0000)
modules/admin-core/src/view/admin_index/wizard.htm [deleted file]
modules/freifunk/root/etc/init.d/luci_freifunk [deleted file]
modules/freifunk/src/model/cbi/admin_index/freifunk.lua
modules/freifunk/src/view/admin_index/wizard.htm [new file with mode: 0644]

diff --git a/modules/admin-core/src/view/admin_index/wizard.htm b/modules/admin-core/src/view/admin_index/wizard.htm
deleted file mode 100644 (file)
index b08703f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<%+header%>
-<h1><%:ffwizard Freifunkassistent%></h1>
-<p><%:ffwizard1 Dieser Assistent konfiguriert den Router für die Benutzung im Freifunknetz%></p>
-<br />
-<form method="post" action="<%=controller%>/admin/index/wizard">
-       <div class="cbi-section-node">
-               <div class="cbi-value">
-                       <div class="cbi-value-title"><%:ip IP-Adresse%>:&nbsp;
-                       <input type="text" size="20" name="ip" /></div>
-               </div>
-               <% for i, k in ipairs(ifaces) do %>
-               <div class="cbi-value">
-                       <div class="cbi-value-title"><%:wificfg Drahtlosgerät einrichten%>: <%=k%></div>
-                       <div class="cbi-value-field"><input type="checkbox" name="wifi.<%=k%>" value="1" checked="checked" /></div>
-               </div>
-               <% end %>
-               <div class="cbi-value">
-                       <div class="cbi-value-title"><%:cfgolsr OLSR konfigurieren%></div>
-                       <div class="cbi-value-field"><input type="checkbox" name="olsr" value="1" checked="checked" /></div>
-               </div>
-               <div class="cbi-value">
-                       <div class="cbi-value-title"><%:cfgdhcp Drahtlos DHCP konfigurieren%></div>
-                       <div class="cbi-value-field"><input type="checkbox" name="dhcp" value="1" checked="checked" /></div>
-               </div>
-               <div class="cbi-value">
-                       <div class="cbi-value-title"><%:cfginternal Erlaube Zugriff von internem Netzwerk%>:</div>
-                       <div class="cbi-value-field"><select name="frominternal">
-                               <option value=""></option>
-<% for k, v in pairs(ffluci.model.uci.sections("network")) do
-       if v[".type"] == "interface" and k ~= "loopback" then %>
-<option value="<%=k%>"<% if k == "lan" then %> selected="selected"<% end %>><%=k%></option>
-<%     end
-end %>
-                       </select></div>
-               </div>
-               <div class="cbi-value">
-                       <div class="cbi-value-title"><%:cfgexternal Erlaube Zugriff auf externes Netzwerk%>:</div>
-                       <div class="cbi-value-field"><select name="toexternal">
-                               <option value=""></option>
-<% for k, v in pairs(ffluci.model.uci.sections("network")) do
-       if v[".type"] == "interface" and k ~= "loopback" then %>
-<option value="<%=k%>"<% if k == "wan" then %> selected="selected"<% end %>><%=k%></option>
-<%     end
-end %>
-                       </select></div>
-               </div>
-               <div class="cbi-value">
-                       <div class="cbi-value-title"><%:shareinet Internetzugang ankündigen%></div>
-                       <div class="cbi-value-field"><input type="checkbox" name="shareinet" value="1" checked="checked" /></div>
-               </div>
-       </div>
-       <br />
-       <div>
-               <input type="submit" value="<%:configure Konfigurieren%>" />
-               <input type="reset" value="<%:reset Zurücksetzen%>" />
-       </div>
-</form> 
-<%+footer%>
\ No newline at end of file
diff --git a/modules/freifunk/root/etc/init.d/luci_freifunk b/modules/freifunk/root/etc/init.d/luci_freifunk
deleted file mode 100644 (file)
index 38779cb..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh /etc/rc.common
-START=70
-
-start() {
-       include /lib/network
-       scan_interfaces
-       
-       
-       ### Read interface names
-       config_get wanif wan ifname
-       config_get lanif lan ifname
-       config_get ffif  ff  ifname
-       config_get ffdif ffdhcp  ifname
-       
-       config_get lanip   lan ipaddr
-       config_get lanmask lan netmask
-       
-       config_get ffip    ff ipaddr
-       config_get ffmask  ff netmask
-       
-       config_get ffdip   ffdhcp ipaddr
-       config_get ffdmask ffdhcp netmask
-       
-       [ -n "$ffif" ] || return 0
-       
-       
-       ### Creating chains
-       iptables -N luci_freifunk_forwarding
-       iptables -t nat -N luci_freifunk_postrouting
-               
-       
-       ### Read from config
-       config_load freifunk
-       
-       config_get_bool internal routing internal
-       [ -n "$wanif" ] && config_get_bool internet routing internet
-       
-       
-       ### Freifunk to Freifunk
-       [ "$internal" -gt 0 ] && {
-               iptables -A luci_freifunk_forwarding -i "$ffif" -o "$ffif" -j ACCEPT
-       }
-       
-       ### Freifunk DHCP to Freifunk
-       [ "$internal" -gt 0 -a -n "$ffdif" ] && {
-               eval "$(ipcalc.sh $ffdip $ffdmask)"
-               
-               iptables -t nat -A luci_freifunk_postrouting -s "$NETWORK/$PREFIX" -o "$ffif" -j MASQUERADE
-       }
-       
-       ### Lan to Freifunk     
-       [ -n "$lanif" ] && {
-               eval "$(ipcalc.sh $lanip $lanmask)"
-               
-               iptables -A luci_freifunk_forwarding -i "$lanif" -o "$ffif" -j ACCEPT
-               iptables -t nat -A luci_freifunk_postrouting -s "$NETWORK/$PREFIX" -o "$ffif" -j MASQUERADE
-       }
-       
-       ### Freifunk to Wan
-       [ "$internet" -gt 0 ] && {              
-               eval "$(ipcalc.sh $ffip $ffmask)"               
-               
-               iptables -A luci_freifunk_forwarding -i "$ffif" -o "$wanif" -j ACCEPT
-               iptables -t nat -A luci_freifunk_postrouting -s "$NETWORK/$PREFIX" -o "$wanif" -j MASQUERADE
-       }
-       
-       ### Freifunk DHCP to Wan
-       [ "$internet" -gt 0 -a -n "$ffdif" ] && {               
-               eval "$(ipcalc.sh $ffdip $ffdmask)"             
-               
-               iptables -t nat -A luci_freifunk_postrouting -s "$NETWORK/$PREFIX" -o "$wanif" -j MASQUERADE
-       }
-       
-       ### Hook in the chains
-       iptables -A forwarding_rule -j luci_freifunk_forwarding
-       iptables -t nat -A postrouting_rule -j luci_freifunk_postrouting
-}
-
-stop() {
-       ### Hook out the chains
-       iptables -D forwarding_rule -j luci_freifunk_forwarding
-       iptables -t nat -D postrouting_rule -j luci_freifunk_postrouting
-       
-       ### Clear the chains
-       iptables -F luci_freifunk_forwarding
-       iptables -t nat -F luci_freifunk_postrouting
-       
-       ### Delete chains
-       iptables -X luci_freifunk_forwarding
-       iptables -t nat -X luci_freifunk_postrouting
-}
index ec4d100b87b04572e232e85277339ef6c565d9ec..fe9e285b49a3b543d9680a9db42375dd129b03f2 100644 (file)
@@ -1,10 +1,6 @@
 -- Todo: Translate
 m = Map("freifunk", "Freifunk")
 
-s = m:section(NamedSection, "routing", "settings", "Netzverkehr")
-s:option(Flag, "internal", "Freifunk zulassen", "immer aktivieren!")
-s:option(Flag, "internet", "Internet zulassen")
-
 c = m:section(NamedSection, "community", "public", "Gemeinschaft", [[Dies sind die Grundeinstellungen
 für die lokale Freifunkgemeinschaft. Diese Werte wirken sich NICHT auf die Konfiguration
 des Routers aus, sondern definieren nur die Vorgaben für den Freifunkassistenten.]])
diff --git a/modules/freifunk/src/view/admin_index/wizard.htm b/modules/freifunk/src/view/admin_index/wizard.htm
new file mode 100644 (file)
index 0000000..b08703f
--- /dev/null
@@ -0,0 +1,58 @@
+<%+header%>
+<h1><%:ffwizard Freifunkassistent%></h1>
+<p><%:ffwizard1 Dieser Assistent konfiguriert den Router für die Benutzung im Freifunknetz%></p>
+<br />
+<form method="post" action="<%=controller%>/admin/index/wizard">
+       <div class="cbi-section-node">
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:ip IP-Adresse%>:&nbsp;
+                       <input type="text" size="20" name="ip" /></div>
+               </div>
+               <% for i, k in ipairs(ifaces) do %>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:wificfg Drahtlosgerät einrichten%>: <%=k%></div>
+                       <div class="cbi-value-field"><input type="checkbox" name="wifi.<%=k%>" value="1" checked="checked" /></div>
+               </div>
+               <% end %>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:cfgolsr OLSR konfigurieren%></div>
+                       <div class="cbi-value-field"><input type="checkbox" name="olsr" value="1" checked="checked" /></div>
+               </div>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:cfgdhcp Drahtlos DHCP konfigurieren%></div>
+                       <div class="cbi-value-field"><input type="checkbox" name="dhcp" value="1" checked="checked" /></div>
+               </div>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:cfginternal Erlaube Zugriff von internem Netzwerk%>:</div>
+                       <div class="cbi-value-field"><select name="frominternal">
+                               <option value=""></option>
+<% for k, v in pairs(ffluci.model.uci.sections("network")) do
+       if v[".type"] == "interface" and k ~= "loopback" then %>
+<option value="<%=k%>"<% if k == "lan" then %> selected="selected"<% end %>><%=k%></option>
+<%     end
+end %>
+                       </select></div>
+               </div>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:cfgexternal Erlaube Zugriff auf externes Netzwerk%>:</div>
+                       <div class="cbi-value-field"><select name="toexternal">
+                               <option value=""></option>
+<% for k, v in pairs(ffluci.model.uci.sections("network")) do
+       if v[".type"] == "interface" and k ~= "loopback" then %>
+<option value="<%=k%>"<% if k == "wan" then %> selected="selected"<% end %>><%=k%></option>
+<%     end
+end %>
+                       </select></div>
+               </div>
+               <div class="cbi-value">
+                       <div class="cbi-value-title"><%:shareinet Internetzugang ankündigen%></div>
+                       <div class="cbi-value-field"><input type="checkbox" name="shareinet" value="1" checked="checked" /></div>
+               </div>
+       </div>
+       <br />
+       <div>
+               <input type="submit" value="<%:configure Konfigurieren%>" />
+               <input type="reset" value="<%:reset Zurücksetzen%>" />
+       </div>
+</form> 
+<%+footer%>
\ No newline at end of file