diff options
author | Manuel Munz <freifunk@somakoma.de> | 2011-10-29 20:33:46 +0000 |
---|---|---|
committer | Manuel Munz <freifunk@somakoma.de> | 2011-10-29 20:33:46 +0000 |
commit | 785cba5563414167fd4d8d4cc63a84b02fa53cda (patch) | |
tree | 44b71077064aa6b0915d2ed48c5523bf3ccd4275 /contrib/package/meshwizard | |
parent | 84cbbf39682ebfc5f662d820294c76988110d55c (diff) |
contrib/meshwizard: Remove original lan-dhcp entry if lan is used for olsrd and fix setup of olsrd hna entries
Diffstat (limited to 'contrib/package/meshwizard')
-rwxr-xr-x | contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh | 2 | ||||
-rwxr-xr-x | contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd_interface.sh | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh index 0a5c96b860..d89da3a5d5 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_dhcp.sh @@ -17,6 +17,8 @@ handle_dnsmasq() { config_load dhcp config_foreach handle_dnsmasq dhcp +[ "$net" == "lan" ] && uci -q delete dhcp.lan + uci batch << EOF set dhcp.${netrenamed}dhcp="dhcp" set dhcp.${netrenamed}dhcp.interface="${netrenamed}dhcp" diff --git a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd_interface.sh b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd_interface.sh index 7472b625d9..f9f07aaa6f 100755 --- a/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd_interface.sh +++ b/contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_olsrd_interface.sh @@ -28,18 +28,15 @@ uci set olsrd.$netrenamed.interface="$netrenamed" uci_commitverbose "Setup olsr interface for $netrenamed." olsrd # 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 -# check if the dhcprange is inside meshnet - -if [ "$dhcp_range" == 1 ]; then - dhcpinmesh="$($dir/helpers/check-range-in-range.sh $dhcprange $meshnet)" +if [ -n "$dhcprange" ]; then 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 ]; then + if [ "$dhcpinmesh" == 1 ] && [ -n "$meshnet" ]; then uci set olsrd.${netrenamed}clients="Hna4" eval $(sh $dir/helpers/ipcalc-cidr.sh $dhcprange) uci set olsrd.${netrenamed}clients.netaddr="$NETWORK" @@ -47,4 +44,3 @@ if [ "$dhcp_range" == 1 ]; then uci_commitverbose "Setup HNA for network $dhcprange" olsrd fi fi - |