2 # Copyright (C) 2011 OpenWrt.org
4 . /usr/share/libubox/jshn.sh
16 local _data="$(ubus call "$1" "$2")"
17 [ $? -ne 0 ] && return "$?"
27 config_get type "$config" type
28 config_get ifname "$config" ifname
29 config_get device "$config" device "$ifname"
30 [ "bridge" = "$type" ] && ifname="br-$config"
31 config_set "$config" device "$ifname"
32 ubus_call "network.interface.$config" status
33 json_get_var l3dev l3_device
34 [ -n "$l3dev" ] && ifname="$l3dev"
36 config_set "$config" ifname "$ifname"
37 config_set "$config" device "$device"
42 config_foreach fixup_interface interface
45 prepare_interface_bridge() {
48 [ -n "$config" ] || return 0
49 ubus call network.interface."$config" prepare
56 [ -n "$config" ] || return 0
57 ubus call network.interface."$config" add_device "{ \"name\": \"$iface\" }"
62 sysctl -n -e -w "$1=$2" >/dev/null || \