- uci -q batch <<-EOF
- set network.$1.proto='dhcp'
- delete network.${1}6
- set network.${1}6='interface'
- set network.${1}6.ifname='$ifname'
- set network.${1}6.proto='dhcpv6'
- EOF
+ uci set network.$1.proto='dhcp'
+ [ -e /proc/sys/net/ipv6 ] && {
+ uci -q batch <<-EOF
+ delete network.${1}6
+ set network.${1}6='interface'
+ set network.${1}6.ifname='$ifname'
+ set network.${1}6.proto='dhcpv6'
+ EOF
+ }