mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix gateway for connection tracking scripts
This commit is contained in:
parent
79df058855
commit
fbef2bfbce
3 changed files with 14 additions and 4 deletions
|
|
@ -58,6 +58,7 @@ interface_multipath_settings() {
|
|||
network_get_ipaddr $config ipaddr
|
||||
ipaddr=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f1 | tr -d "\n")
|
||||
gateway=$(ip -4 r list dev $iface | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n")
|
||||
[ -z "$gateway" ] && gateway=$(uci -q get "network.$config.gateway")
|
||||
[ -z "$gateway" ] && gateway=$(ubus call network.interface.$config status | jsonfilter -e '@.route[0].nexthop' | tr -d "\n")
|
||||
[ -z "$gateway" ] && gateway=$(ubus call network.interface.$config status | jsonfilter -e '@.inactive.route[0].nexthop' | tr -d "\n")
|
||||
netmask=$(ip -4 addr show dev $iface | grep inet | awk '{print $2}' | cut -d/ -f2 | tr -d "\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue