From 3676a6fde68b4cbe8b2c641896f8b7d271a208af Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 16 Feb 2021 10:46:45 +0100 Subject: [PATCH 1/7] Fix obfuscation choice --- .../luasrc/view/openmptcprouter/settings.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm index 7ae4100b4..e9d4f52a8 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm @@ -97,7 +97,7 @@ end if obfs_installed then %> - + <% end %> From 5b9f6a8ed0e500612340483bb5198e67ffe0f65b Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 17 Feb 2021 14:31:40 +0100 Subject: [PATCH 2/7] No create _4 interface when DHCPv6 set in wizard --- luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 3e81c8e59..b71efc888 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -313,6 +313,8 @@ function wizard_add() ucic:set("network",intf,"reqaddress","try") ucic:set("network",intf,"reqprefix","no") ucic:set("network",intf,"iface_map","0") + ucic:set("network",intf,"iface_dslite","0") + ucic:set("network",intf,"iface_464xlate","0") ucic:set("network",intf,"ipv6","1") end From 18f2034668937760994a3b792290c17ac9ee1d80 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 17 Feb 2021 14:32:24 +0100 Subject: [PATCH 3/7] Display whois of IPv6 address in status page if not same as IPv4 whois --- .../luasrc/view/openmptcprouter/wanstatus.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm index 83f601bbf..794dccb31 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm @@ -498,7 +498,7 @@ local statuslogo = ucic:get("openmptcprouter","settings","statuslogo") or "openm { content += String.format('%s %s
','<%:whois:%>', whois); } - if(whois6 !== '') + if(whois6 !== '' && whois6 != whois) { content += String.format('%s %s
','<%:whois:%>', whois6); } From c97370d4108ee0e086fc3a6ec7c9667e97eb8ffe Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 17 Feb 2021 14:32:45 +0100 Subject: [PATCH 4/7] Fix QMI info --- luci-app-openmptcprouter/root/bin/omr-qmi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openmptcprouter/root/bin/omr-qmi b/luci-app-openmptcprouter/root/bin/omr-qmi index 1a73d4f37..8721ffb12 100755 --- a/luci-app-openmptcprouter/root/bin/omr-qmi +++ b/luci-app-openmptcprouter/root/bin/omr-qmi @@ -24,6 +24,6 @@ elif [ "$TYPE" = "lte" ]; then fi [ -z "$INFO" ] && echo $PERCENT && return OPERATOR=$(timeout 1 uqmi -d $MODEM_INTF --get-serving-system | jsonfilter -e '@.plmn_description' | tr -d '\n') -NUMBER=$(timeout 1 uqmi -d $MODEM_INTF --msisdn | jsonfilter -e '@' | tr -d '\n') +NUMBER=$(timeout 1 uqmi -d $MODEM_INTF --get-msisdn | jsonfilter -e '@' | tr -d '\n') STATE=$(timeout 1 uqmi -d $MODEM_INTF --get-data-status | jsonfilter -e '@' | tr -d '\n') [ "$INFO" = "all" ] && echo "$PERCENT;$OPERATOR;$NUMBER;$TATE;$TYPE" \ No newline at end of file From c80f9a017a2b0720f81dc46d78425f997fb19d35 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 17 Feb 2021 14:33:07 +0100 Subject: [PATCH 5/7] Get public ip only when needed --- .../root/usr/libexec/rpcd/openmptcprouter | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter index bc36f9649..b86f4d287 100755 --- a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter +++ b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter @@ -1373,20 +1373,20 @@ function interfaces_status() if connectivity ~= "ERROR" then if ifname ~= nil and ifname:match("^tun.*") and interface:match("^ovpn.*") then publicIP = uci:get("openmptcprouter",interface:sub(5),"publicip") or "" - if ifname ~= nil and publicIP == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then + if ifname ~= nil and ipaddr ~= "" and publicIP == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then publicIP = ut.trim(sys.exec("omr-ip-intf " .. get_device(interface:sub(5)))) end publicIP6 = uci:get("openmptcprouter",interface:sub(5),"publicip6") or "" - if ifname ~= nil and publicIP6 == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then + if ifname ~= nil and ip6addr ~= "" and publicIP6 == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then publicIP6 = ut.trim(sys.exec("omr-ip6-intf " .. get_device(interface:sub(5)))) end else publicIP = uci:get("openmptcprouter",interface,"publicip") or "" - if ifname ~= nil and publicIP == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then + if ifname ~= nil and ipaddr ~= "" and publicIP == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then publicIP = ut.trim(sys.exec("omr-ip-intf " .. ifname)) end publicIP6 = uci:get("openmptcprouter",interface,"publicip6") or "" - if ifname ~= nil and publicIP6 == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then + if ifname ~= nil and ip6addr ~= "" and publicIP6 == "" and mArray.openmptcprouter["external_check"] ~= false and mArray.openmptcprouter["dns"] == true then publicIP6 = ut.trim(sys.exec("omr-ip6-intf " .. ifname)) end end From 01d9b7efc1d0a8c50075e2bbadb220c288ac244c Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 17 Feb 2021 14:33:46 +0100 Subject: [PATCH 6/7] Get public ip only if IPv4/IPv6 set on interface --- mptcp/files/usr/share/omr/post-tracking.d/post-tracking | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking index aaa044cae..e00d99fee 100755 --- a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking +++ b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking @@ -970,9 +970,11 @@ fi # Save wan settings for status page if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(date +"%s") + $((30 + RANDOM % 31)) - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc))) -gt 3600 ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.state)" = "down" ]; then [ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Get status and settings for $OMR_TRACKER_INTERFACE..." + local ipaddr="" + local ip6addr="" if [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ]; then - local ipaddr="$(omr-ip-intf $OMR_TRACKER_DEVICE)" - local ip6addr="$(omr-ip6-intf $OMR_TRACKER_DEVICE)" + [ -n "$OMR_TRACKER_DEVICE_IP" ] && ipaddr="$(omr-ip-intf $OMR_TRACKER_DEVICE)" + [ -n "$OMR_TRACKER_DEVICE_IP6" ] && ip6addr="$(omr-ip6-intf $OMR_TRACKER_DEVICE)" else uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s") uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state="up" From b178e7f4603050048d11261835a1d5229926f191 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 17 Feb 2021 14:34:27 +0100 Subject: [PATCH 7/7] Get IPv4 in tracker if DHCPv6 not set --- omr-tracker/files/bin/omr-tracker | 116 ++++++++++++++++-------------- 1 file changed, 61 insertions(+), 55 deletions(-) diff --git a/omr-tracker/files/bin/omr-tracker b/omr-tracker/files/bin/omr-tracker index b046c6500..e42a26cab 100755 --- a/omr-tracker/files/bin/omr-tracker +++ b/omr-tracker/files/bin/omr-tracker @@ -175,6 +175,7 @@ _none() { _restart +OMR_TRACKER_INTERFACE_PROTO="$(uci -q get network.${OMR_TRACKER_INTERFACE_PROTO}.proto)" OMR_TRACKER_PREV_STATUS="" # main loop while true; do @@ -193,63 +194,68 @@ while true; do if [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then if [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep UP)" ]; then # retrieve iface ip and gateway - OMR_TRACKER_DEVICE_IP=$(ip -4 -br addr ls dev "$OMR_TRACKER_DEVICE" | awk -F'[ /]+' '{print $3}') - if [ -z "$OMR_TRACKER_DEVICE_IP" ]; then - OMR_TRACKER_DEVICE_IP=$(ip -4 addr show dev "$OMR_TRACKER_DEVICE" | grep -m 1 inet | awk '{print $2}' | cut -d'/' -s -f1) - fi - #OMR_TRACKER_DEVICE_IP6=$(ip -6 -br addr ls dev "$OMR_TRACKER_DEVICE" | awk -F'[ /]+' '{print $3}') - #if [ -z "$OMR_TRACKER_DEVICE_IP6" ]; then - OMR_TRACKER_DEVICE_IP6=$(ip -6 addr show dev "$OMR_TRACKER_DEVICE" | grep -v 'inet6 f' | grep -m 1 inet | awk '{print $2}' | cut -d'/' -s -f1) - #fi - #OMR_TRACKER_DEVICE_IP=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -e '@["ipv4-address"][0].address' | tr -d "\n") - #if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then - # OMR_TRACKER_DEVICE_GATEWAY=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n") - #fi - if [ "$OMR_TRACKER_DEVICE" = "bonding-omrvpn" ]; then - OMR_TRACKER_DEVICE_GATEWAY="10.255.248.1" - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then - OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get "network.$OMR_TRACKER_INTERFACE.gateway") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then - OMR_TRACKER_DEVICE_GATEWAY=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -q -l 1 -e '@.inactive.route[@.target="0.0.0.0"].nexthop' | tr -d "\n") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then - OMR_TRACKER_DEVICE_GATEWAY=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -q -l 1 -e '@.route[@.target="0.0.0.0"].nexthop' | tr -d "\n") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then - OMR_TRACKER_DEVICE_GATEWAY=$(ubus call network.interface.${OMR_TRACKER_INTERFACE}_4 status 2>/dev/null | jsonfilter -q -l 1 -e '@.inactive.route[@.target="0.0.0.0"].nexthop' | tr -d "\n") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then - if [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" = "1" ]; then - OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get glorytun.vpn.remoteip) - elif [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" = "1" ]; then - OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get glorytun-udp.vpn.remoteip) - else - OMR_TRACKER_DEVICE_GATEWAY="" + if [ "$OMR_TRACKER_INTERFACE_PROTO" != "dhcpv6" ]; then + OMR_TRACKER_DEVICE_IP=$(ip -4 -br addr ls dev "$OMR_TRACKER_DEVICE" | awk -F'[ /]+' '{print $3}') + if [ -z "$OMR_TRACKER_DEVICE_IP" ]; then + OMR_TRACKER_DEVICE_IP=$(ip -4 addr show dev "$OMR_TRACKER_DEVICE" | grep -m 1 inet | awk '{print $2}' | cut -d'/' -s -f1) + fi + #OMR_TRACKER_DEVICE_IP=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -e '@["ipv4-address"][0].address' | tr -d "\n") + #if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then + # OMR_TRACKER_DEVICE_GATEWAY=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | grep -v default | awk '/proto static/ {print $1}' | tr -d "\n") + #fi + if [ "$OMR_TRACKER_DEVICE" = "bonding-omrvpn" ]; then + OMR_TRACKER_DEVICE_GATEWAY="10.255.248.1" + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then + OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get "network.$OMR_TRACKER_INTERFACE.gateway") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then + OMR_TRACKER_DEVICE_GATEWAY=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -q -l 1 -e '@.inactive.route[@.target="0.0.0.0"].nexthop' | tr -d "\n") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then + OMR_TRACKER_DEVICE_GATEWAY=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -q -l 1 -e '@.route[@.target="0.0.0.0"].nexthop' | tr -d "\n") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then + OMR_TRACKER_DEVICE_GATEWAY=$(ubus call network.interface.${OMR_TRACKER_INTERFACE}_4 status 2>/dev/null | jsonfilter -q -l 1 -e '@.inactive.route[@.target="0.0.0.0"].nexthop' | tr -d "\n") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then + if [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" = "1" ]; then + OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get glorytun.vpn.remoteip) + elif [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] && [ "$(uci -q get glorytun-udp.vpn.enable)" = "1" ]; then + OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get glorytun-udp.vpn.remoteip) + else + OMR_TRACKER_DEVICE_GATEWAY="" + fi + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then + OMR_TRACKER_DEVICE_ROUTE=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | grep via | grep -v default | grep -v metric | grep -v / | awk '{print $1; exit}' | tr -d "\n") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then + OMR_TRACKER_DEVICE_GATEWAY=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | grep kernel | awk '/proto kernel/ {print $1}' | tr -d "\n") fi fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then - OMR_TRACKER_DEVICE_ROUTE=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | grep via | grep -v default | grep -v metric | grep -v / | awk '{print $1; exit}' | tr -d "\n") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then - OMR_TRACKER_DEVICE_GATEWAY=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | grep kernel | awk '/proto kernel/ {print $1}' | tr -d "\n") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then - OMR_TRACKER_DEVICE_GATEWAY6=$(uci -q get "network.$OMR_TRACKER_INTERFACE.ip6gw") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then - OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.${OMR_TRACKER_INTERFACE} status 2>/dev/null | jsonfilter -q -l 1 -e "@.inactive.route[@.source=\"${OMR_TRACKER_DEVICE_IP6}\"].nexthop" | tr -d "\n") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then - OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.${OMR_TRACKER_INTERFACE} status 2>/dev/null | jsonfilter -q -l 1 -e "@.inactive.route[@.source=\"${OMR_TRACKER_DEVICE_IP6}/64\"].nexthop" | tr -d "\n") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then - OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.${OMR_TRACKER_INTERFACE} status 2>/dev/null | jsonfilter -q -l 1 -e "@.inactive.route[@.source=\"${OMR_TRACKER_DEVICE_IP6}/56\"].nexthop" | tr -d "\n") - fi - if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then - OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -q -l 1 -e '@.route[@.target="::"].nexthop' | tr -d "\n") - fi + #OMR_TRACKER_DEVICE_IP6=$(ip -6 -br addr ls dev "$OMR_TRACKER_DEVICE" | awk -F'[ /]+' '{print $3}') + #if [ -z "$OMR_TRACKER_DEVICE_IP6" ]; then + OMR_TRACKER_DEVICE_IP6=$(ip -6 addr show dev "$OMR_TRACKER_DEVICE" | grep -v 'inet6 f' | grep -m 1 inet | awk '{print $2}' | cut -d'/' -s -f1) + #fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ]; then + OMR_TRACKER_DEVICE_GATEWAY6=$(uci -q get "network.$OMR_TRACKER_INTERFACE.ip6gw") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then + OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.${OMR_TRACKER_INTERFACE} status 2>/dev/null | jsonfilter -q -l 1 -e "@.inactive.route[@.source=\"${OMR_TRACKER_DEVICE_IP6}\"].nexthop" | tr -d "\n") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then + OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.${OMR_TRACKER_INTERFACE} status 2>/dev/null | jsonfilter -q -l 1 -e "@.inactive.route[@.source=\"${OMR_TRACKER_DEVICE_IP6}/64\"].nexthop" | tr -d "\n") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then + OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.${OMR_TRACKER_INTERFACE} status 2>/dev/null | jsonfilter -q -l 1 -e "@.inactive.route[@.source=\"${OMR_TRACKER_DEVICE_IP6}/56\"].nexthop" | tr -d "\n") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then + OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -q -l 1 -e '@.route[@.target="::"].nexthop' | tr -d "\n") + fi + if [ -z "$OMR_TRACKER_DEVICE_GATEWAY6" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY6" = "::" ]; then + OMR_TRACKER_DEVICE_GATEWAY6=$(ubus call network.interface.$OMR_TRACKER_INTERFACE status | jsonfilter -q -l 1 -e '@.route[@.nexthop="::"].target' | tr -d "\n") + fi # execute specific tracker if [ -n "$OMR_TRACKER_DEVICE_IP" ] && [ -n "$OMR_TRACKER_DEVICE_GATEWAY" ]; then