2 # Sets up the dhcp part of dnsmasq
8 vap="$(uci -q get meshwizard.netconfig.${net}_vap)"
11 config_get interface "$1" interface
12 if [ "$interface" == "${netrenamed}dhcp" ]; then
13 if [ -z "${1/cfg[0-9a-fA-F]*/}" ]; then
14 section_rename dhcp $1 ${netrenamed}dhcp
19 config_foreach handle_dnsmasq dhcp
21 [ "$net" == "lan" ] && uci -q delete dhcp.lan
23 if [ "$supports_vap" = 1 -a "$vap" = 1 ]; then
25 set dhcp.${netrenamed}dhcp="dhcp"
26 set dhcp.${netrenamed}dhcp.ignore="0"
27 set dhcp.${netrenamed}dhcp.interface="${netrenamed}dhcp"
29 set_defaults "dhcp_" dhcp.${netrenamed}dhcp
32 ahdhcp_when_vap="$(uci get profile_$community.profile.adhoc_dhcp_when_vap)"
33 if [ "$supports_vap" = 0 ] || \
34 [ "$supports_vap" = 1 -a "$vap" = 1 -a "$ahdhcp_when_vap" = 1 ] || \
35 [ "$lan_is_olsr" = "1" -a "$lan_dhcp" = 1 ]; then
37 set dhcp.${netrenamed}ahdhcp="dhcp"
38 set dhcp.${netrenamed}ahdhcp.ignore="0"
39 set dhcp.${netrenamed}ahdhcp.interface="${netrenamed}ahdhcp"
42 set_defaults "dhcp_" dhcp.${netrenamed}ahdhcp
44 uci_commitverbose "Setup DHCP for $netrenamed" dhcp