Changeset 31960


Ignore:
Timestamp:
2012-05-29T02:20:16+02:00 (6 years ago)
Author:
jow
Message:

[package] base-files: let network_get_device() return the l3 interface, introduce network_get_physdev() to obtain the underlying iface (if applicable)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/base-files/files/lib/functions/network.sh

    r31937 r31960  
    4242 
    4343 
    44 network_get_device() 
     44__network_device() 
    4545{ 
    4646        local __var="$1" 
    4747        local __iface="$2" 
     48        local __field="$3" 
    4849 
    4950        local __tmp="$(ubus call network.interface."$__iface" status 2>/dev/null)" 
     
    5152 
    5253        json_load "$__tmp" 
    53         json_get_var "$__var" device 
     54        json_get_var "$__var" "$__field" 
     55} 
    5456 
    55         return 0 
    56 } 
     57network_get_device()  { __network_device "$1" "$2" l3_device; } 
     58network_get_physdev() { __network_device "$1" "$2" device;    } 
Note: See TracChangeset for help on using the changeset viewer.