proto_init_update "$ifname" 1
proto_send_update "$interface"
+ [ -z "$dhcp" ] && dhcp=1
+ [ -z "$dhcpv6" ] && dhcpv6=1
+
[ "$iptype" != "ipv6" ] && {
- if [ -z "$dhcp" -o "$dhcp" = 0 ]; then
+ if [ -n "$ipv4address" ]; then
json_init
json_add_string name "${interface}_4"
json_add_string ifname "@$interface"
[ -n "$zone" ] && json_add_string zone "$zone"
json_close_object
ubus call network add_dynamic "$(json_dump)"
- else
+ elif [ "$dhcp" != 0 ]; then
echo "mbim[$$]" "Starting DHCP on $ifname"
json_init
json_add_string name "${interface}_4"
}
[ "$iptype" != "ipv4" ] && {
- if [ -z "$dhcpv6" -o "$dhcpv6" = 0 ]; then
+ if [ -n "$ipv6address" ]; then
json_init
json_add_string name "${interface}_6"
json_add_string ifname "@$interface"
[ -n "$zone" ] && json_add_string zone "$zone"
json_close_object
ubus call network add_dynamic "$(json_dump)"
- else
+ elif [ "$dhcpv6" != 0 ]; then
echo "mbim[$$]" "Starting DHCPv6 on $ifname"
json_init
json_add_string name "${interface}_6"