1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

No error in log from omr-tracker

This commit is contained in:
Ycarus 2018-09-17 10:59:04 +02:00
parent 3164df114a
commit 8ce2c27338

View file

@ -7,7 +7,7 @@ set_route() {
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=$(uci -q get network.$INTERFACE.ifname)
[ -z "$interface_if" ] && interface_if=$(ifstatus "$INTERFACE" | 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"]')
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
@ -15,13 +15,13 @@ set_route() {
#if [ "$multipath_config" != "off" ] && [ "$INTERFACE" != "$PREVINTERFACE" ] && [ "$SETROUTE" != true ]; then #if [ "$multipath_config" != "off" ] && [ "$INTERFACE" != "$PREVINTERFACE" ] && [ "$SETROUTE" != true ]; then
interface_gw="$(uci -q get network.$INTERFACE.gateway)" interface_gw="$(uci -q get network.$INTERFACE.gateway)"
if [ -z "$interface_gw" ]; then if [ -z "$interface_gw" ]; then
interface_gw=$(ubus call network.interface.$INTERFACE status | jsonfilter -q -e '@.route[0].nexthop' | tr -d "\n") interface_gw=$(ubus call network.interface.$INTERFACE status 2>/dev/null | jsonfilter -q -e '@.route[0].nexthop' | tr -d "\n")
fi fi
if [ -z "$interface_gw" ]; then if [ -z "$interface_gw" ]; then
interface_gw=$(ubus call network.interface.$INTERFACE status | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") interface_gw=$(ubus call network.interface.$INTERFACE status 2>/dev/null | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n")
fi fi
if [ -z "$interface_gw" ]; then if [ -z "$interface_gw" ]; then
interface_gw=$(ubus call network.interface.${INTERFACE}_4 status | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n") interface_gw=$(ubus call network.interface.${INTERFACE}_4 status 2>/dev/null | jsonfilter -q -e '@.inactive.route[0].nexthop' | tr -d "\n")
fi fi
if [ "$interface_gw" != "" ]; then if [ "$interface_gw" != "" ]; then
_log "$PREVINTERFACE down. Replace default route by $interface_gw dev $interface_if" _log "$PREVINTERFACE down. Replace default route by $interface_gw dev $interface_if"