#!/bin/sh echo "Soll dieser Router als Gateway arbeiten? (j/n) " read router echo if [[ $router = "j" ]] then #Act a a Router #set ipv4 Adress echo "Bitte geben sie die IP-Adresse des Routers an (siehe http://www.freifunk-jena.de/NodeDB)" read ipv4_adress #IP Zerlegen oct1=`echo $ipv4_adress | awk -F . '{print $1}'` oct2=`echo $ipv4_adress | awk -F . '{print $2}'` oct3=`echo $ipv4_adress | awk -F . '{print $3}'` oct4=`echo $ipv4_adress | awk -F . '{print $4}'` uci set network.mesh.ipaddr=$ipv4_adress uci set network.mesh.proto=static uci set network.mesh.netmask=255.255.0.0 uci set dhcp.mesh=dhcp uci set dhcp.mesh.start=2 uci set dhcp.mesh.limit=254 uci set dhcp.mesh.leasetime=12h uci set dhcp.mesh.interface=mesh uci set dhcp.mesh.start_ip=10.17.$oct3.2 uci set dhcp.mesh.end_ip=10.17.$oct3.254 uci commit dhcp # Batman Server Mode uci set batman-adv.bat0.gw_mode=server uci commit batman-adv else # Act as a node only uci del dhcp.mesh uci commit dhcp uci del network.mesh.ipaddr uci del network.mesh.proto uci del network.mesh.netmask uci commit network echo "Der Router wird als normaler Node konfiguriert" echo # Batman Clientr Mode uci set batman-adv.bat0.gw_mode=client uci commit batman-adv fi uci commit #TODO: Generate Subnet #TODO: DHCP Configuration #HINT: Port freifunk-wizzard-leipzig in from lua (http://luci.subsignal.org/trac/browser/luci/branches/luci-0.10/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua)