contrib/meshwizard: Remove original lan-dhcp entry if lan is used for olsrd and fix setup of olsrd hna entries
This commit is contained in:
parent
84cbbf3968
commit
785cba5563
2 changed files with 6 additions and 8 deletions
|
@ -17,6 +17,8 @@ handle_dnsmasq() {
|
||||||
config_load dhcp
|
config_load dhcp
|
||||||
config_foreach handle_dnsmasq dhcp
|
config_foreach handle_dnsmasq dhcp
|
||||||
|
|
||||||
|
[ "$net" == "lan" ] && uci -q delete dhcp.lan
|
||||||
|
|
||||||
uci batch << EOF
|
uci batch << EOF
|
||||||
set dhcp.${netrenamed}dhcp="dhcp"
|
set dhcp.${netrenamed}dhcp="dhcp"
|
||||||
set dhcp.${netrenamed}dhcp.interface="${netrenamed}dhcp"
|
set dhcp.${netrenamed}dhcp.interface="${netrenamed}dhcp"
|
||||||
|
|
|
@ -28,18 +28,15 @@ uci set olsrd.$netrenamed.interface="$netrenamed"
|
||||||
uci_commitverbose "Setup olsr interface for $netrenamed." olsrd
|
uci_commitverbose "Setup olsr interface for $netrenamed." olsrd
|
||||||
|
|
||||||
# If dhcp-network is inside the mesh_network then add HNA for it
|
# If dhcp-network is inside the mesh_network then add HNA for it
|
||||||
dhcprange=$(uci -q get meshwizard.netconfig.$net\_dhcprange)
|
|
||||||
|
|
||||||
|
dhcprange=$(uci -q get meshwizard.netconfig.$net\_dhcprange)
|
||||||
uci -q delete olsrd.${netrenamed}clients
|
uci -q delete olsrd.${netrenamed}clients
|
||||||
|
|
||||||
# check if the dhcprange is inside meshnet
|
if [ -n "$dhcprange" ]; then
|
||||||
|
|
||||||
if [ "$dhcp_range" == 1 ]; then
|
|
||||||
dhcpinmesh="$($dir/helpers/check-range-in-range.sh $dhcprange $meshnet)"
|
|
||||||
meshnet="$(uci get profile_$community.profile.mesh_network)"
|
meshnet="$(uci get profile_$community.profile.mesh_network)"
|
||||||
|
dhcpinmesh="$($dir/helpers/check-range-in-range.sh $dhcprange $meshnet)"
|
||||||
|
|
||||||
# If it is setup hna for it
|
if [ "$dhcpinmesh" == 1 ] && [ -n "$meshnet" ]; then
|
||||||
if [ "$dhcpinmesh" == 1 ]; then
|
|
||||||
uci set olsrd.${netrenamed}clients="Hna4"
|
uci set olsrd.${netrenamed}clients="Hna4"
|
||||||
eval $(sh $dir/helpers/ipcalc-cidr.sh $dhcprange)
|
eval $(sh $dir/helpers/ipcalc-cidr.sh $dhcprange)
|
||||||
uci set olsrd.${netrenamed}clients.netaddr="$NETWORK"
|
uci set olsrd.${netrenamed}clients.netaddr="$NETWORK"
|
||||||
|
@ -47,4 +44,3 @@ if [ "$dhcp_range" == 1 ]; then
|
||||||
uci_commitverbose "Setup HNA for network $dhcprange" olsrd
|
uci_commitverbose "Setup HNA for network $dhcprange" olsrd
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue