Skip to content

Commit

Permalink
Fix IPv6 route and add some logs in OMR-Tracker Post Tracking up script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Jul 26, 2024
1 parent 8730f78 commit 59c1332
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion omr-tracker/files/usr/share/omr/post-tracking.d/003-up
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ if [ "$multipath_config" = "master" ]; then
ip route replace default scope global metric 999 $routesbalancingbackup >/dev/null 2>&1
}
}
elif [ -n "$omrvpn_intf" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ] && [ "$(ip -6 route show default | grep -v metric | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ]; then
elif [ -n "$omrvpn_intf" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ] && [ "$(ip -6 route show default metric 1 | tr -d '\t' | tr -d '\n' | sed 's/ *$//')" != "default via $routesbalancing6" ]; then
routesbalancing6=""
routesbalancingbackup6=""
nbintf6=0
Expand All @@ -930,7 +930,9 @@ if [ "$multipath_config" = "master" ]; then
[ -n "$routesbalancing6" ] && {
{ [ "$nbintf6" -gt "1" ] && [ "$(ip -6 r show default metric 1 | tr -d '\t' | tr -d '\n' | sed 's/ *$//')" != "default via $routesbalancing6 " ] && [ "$(ip -6 r show default metric 1 | tr -d '\t' | tr -d '\n' | sed 's/ *$//')" != "default $routesbalancing6 " ]; } || { [ "$nbintf6" = "1" ] && [ "$(ip -6 r show default metric 1 | grep $OMR_TRACKER_DEVICE)" = "" ] && [ "$(ip -6 r show default metric 1 | grep omr6in4)" = "" ] && [ -n "$OMR_TRACKER_DEVICE_IP6" ]; } && {
_log "Set ip -6 route replace default scope global metric 1 $routesbalancing6"
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Current route: $(ip -6 r)"
ip -6 route replace default scope global metric 1 $routesbalancing6 >/dev/null 2>&1
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "New route: $(ip -6 r)"
}
}
[ -n "$routesbalancingbackup6" ] && {
Expand Down

0 comments on commit 59c1332

Please sign in to comment.