mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 10:31:51 +00:00
Get device from l3_device
This commit is contained in:
parent
5f9cee0fda
commit
799b129336
2 changed files with 5 additions and 4 deletions
|
@ -6,9 +6,9 @@ set_route() {
|
|||
INTERFACE=$1
|
||||
PREVINTERFACE=$2
|
||||
multipath_config=$(uci -q get network.$INTERFACE.multipath || echo "off")
|
||||
interface_if=$(uci -q get network.$INTERFACE.ifname)
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(ifstatus "${INTERFACE}_4" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$interface_if" ] && interface_if=$(uci -q get network.$INTERFACE.ifname)
|
||||
multipath_current_config=$(multipath $interface_if | grep 'deactivated')
|
||||
if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ] && [ "$INTERFACE" != "$PREVINTERFACE" ] && [ "$multipath_current_config" = "" ]; then
|
||||
interface_gw="$(uci -q get network.$INTERFACE.gateway)"
|
||||
|
|
|
@ -45,8 +45,9 @@ _launch_tracker() {
|
|||
_validate_section "interface" "$1"
|
||||
|
||||
local ifname ip4table
|
||||
config_get ifname "$1" ifname
|
||||
[ -z "$ifname" ] && ifname=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
|
||||
ifname=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$ifname" ] && ifname=$(ifstatus "$1_4" | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$ifname" ] && config_get ifname "$1" ifname
|
||||
|
||||
config_get multipath "$1" multipath
|
||||
config_get ifenabled "$1" auto
|
||||
|
|
Loading…
Reference in a new issue