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
31 dhcprange
=$
(uci
-q get meshwizard.netconfig.
$net\_dhcprange
)
33 uci
-q delete olsrd.
${netrenamed}clients
35 # check if the dhcprange is inside meshnet
37 if [ "$dhcp_range" == 1 ]; then
38 dhcpinmesh
="$($dir/helpers/check-range-in-range.sh $dhcprange $meshnet)"
39 meshnet
="$(uci get profile_$community.profile.mesh_network)"
41 # If it is setup hna for it
42 if [ "$dhcpinmesh" == 1 ]; then
43 uci
set olsrd.
${netrenamed}clients
="Hna4"
44 eval $
(sh
$dir/helpers
/ipcalc-cidr.sh
$dhcprange)
45 uci
set olsrd.
${netrenamed}clients.netaddr
="$NETWORK"
46 uci
set olsrd.
${netrenamed}clients.netmask
="$NETMASK"
47 uci_commitverbose
"Setup HNA for network $dhcprange" olsrd