2 # Sets up olsrd interfaces
10 # Rename interface for $netrenamed
12 config_get interface "$1" Interface
13 if [ "$interface" == "$netrenamed" ]; then
14 if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then
15 section_rename olsrd $1 $netrenamed
20 config_foreach handle_interface Interface
22 # Setup new interface for $netrenamed
24 uci set olsrd.$netrenamed=Interface
25 set_defaults "olsr_interface_" olsrd.$net
26 uci set olsrd.$netrenamed.interface="$netrenamed"
28 uci_commitverbose "Setup olsr interface for $netrenamed." olsrd
30 # If dhcp-network is inside the mesh_network then add HNA for it
32 dhcprange=$(uci -q get meshwizard.netconfig.$net\_dhcprange)
33 uci -q delete olsrd.${netrenamed}clients
35 if [ -n "$dhcprange" ]; then
36 meshnet="$(uci get profile_$community.profile.mesh_network)"
37 dhcpinmesh="$($dir/helpers/check-range-in-range.sh $dhcprange $meshnet)"
39 if [ "$dhcpinmesh" == 1 ] && [ -n "$meshnet" ]; then
40 uci set olsrd.${netrenamed}clients="Hna4"
41 eval $(sh $dir/helpers/ipcalc-cidr.sh $dhcprange)
42 uci set olsrd.${netrenamed}clients.netaddr="$NETWORK"
43 uci set olsrd.${netrenamed}clients.netmask="$NETMASK"
44 uci_commitverbose "Setup HNA for network $dhcprange" olsrd