1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00

Get device from l3_device

This commit is contained in:
Ycarus 2019-03-28 21:35:05 +01:00
parent 5f9cee0fda
commit 799b129336
2 changed files with 5 additions and 4 deletions

View file

@ -6,9 +6,9 @@ set_route() {
INTERFACE=$1 INTERFACE=$1
PREVINTERFACE=$2 PREVINTERFACE=$2
multipath_config=$(uci -q get network.$INTERFACE.multipath || echo "off") multipath_config=$(uci -q get network.$INTERFACE.multipath || echo "off")
interface_if=$(uci -q get network.$INTERFACE.ifname) interface_if=$(ifstatus "$INTERFACE" 2>/dev/null | jsonfilter -q -e '@["l3_device"]')
[ -z "$interface_if" ] && 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=$(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') multipath_current_config=$(multipath $interface_if | grep 'deactivated')
if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ] && [ "$INTERFACE" != "$PREVINTERFACE" ] && [ "$multipath_current_config" = "" ]; then if [ "$multipath_config" != "off" ] && [ "$SETROUTE" != true ] && [ "$INTERFACE" != "$PREVINTERFACE" ] && [ "$multipath_current_config" = "" ]; then
interface_gw="$(uci -q get network.$INTERFACE.gateway)" interface_gw="$(uci -q get network.$INTERFACE.gateway)"

View file

@ -45,8 +45,9 @@ _launch_tracker() {
_validate_section "interface" "$1" _validate_section "interface" "$1"
local ifname ip4table local ifname ip4table
config_get ifname "$1" ifname ifname=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
[ -z "$ifname" ] && 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 multipath "$1" multipath
config_get ifenabled "$1" auto config_get ifenabled "$1" auto