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.interface="${netrenamed}dhcp"
28 set_defaults "dhcp_" dhcp.${netrenamed}dhcp
31 ahdhcp_when_vap="$(uci get profile_$community.profile.adhoc_dhcp_when_vap)"
32 if [ "$supports_vap" = 0 ] || [ "$supports_vap" = 1 -a "$vap" = 1 -a "$ahdhcp_when_vap" = 1 ]; then
34 set dhcp.${netrenamed}ahdhcp="dhcp"
35 set dhcp.${netrenamed}ahdhcp.interface="${netrenamed}ahdhcp"
38 set_defaults "dhcp_" dhcp.${netrenamed}ahdhcp
40 uci_commitverbose "Setup DHCP for $netrenamed" dhcp