mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix get device
This commit is contained in:
parent
ae8371b2cc
commit
bc498724ff
1 changed files with 4 additions and 2 deletions
|
@ -85,7 +85,9 @@ interface_multipath_settings() {
|
|||
local enabled
|
||||
|
||||
config_get enabled "$config" auto "1"
|
||||
iface=$(ifstatus "$config" | jsonfilter -q -e '@["l3_device"]')
|
||||
network_get_device iface $config
|
||||
[ -z "$iface" ] && network_get_physdev iface $config
|
||||
[ -z "$iface" ] && iface=$(ifstatus "$config" | jsonfilter -q -e '@["l3_device"]')
|
||||
[ -z "$iface" ] && config_get iface "$config" ifname
|
||||
config_get txqueuelen "$config" txqueuelen
|
||||
[ -n "$(echo $iface | grep '@')" ] && iface=$(ifstatus "$config" | jsonfilter -q -e '@["device"]')
|
||||
|
@ -176,7 +178,7 @@ interface_multipath_settings() {
|
|||
config_get gateway $config gateway
|
||||
config_get netmask $config netmask
|
||||
[ -n "$ipaddr" ] && [ -n "$netmask" ] && netmask=`ipcalc.sh $ipaddr $netmask | sed -n '/PREFIX=/{;s/.*=//;s/ .*//;p;}'`
|
||||
[ -n "$îpaddr" ] && [ -n "$netmask" ] && network=`ipcalc.sh $ipaddr $netmask | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'`
|
||||
[ -n "$ipaddr" ] && [ -n "$netmask" ] && network=`ipcalc.sh $ipaddr $netmask | sed -n '/NETWORK=/{;s/.*=//;s/ .*//;p;}'`
|
||||
elif [ "$proto" != "gre" ]; then
|
||||
network_get_ipaddr ipaddr $config
|
||||
[ -z "$ipaddr" ] && ipaddr=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue