Skip to content

Commit

Permalink
Fix gateway for OpenVPN in some case
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Nov 7, 2023
1 parent c532098 commit 2d6ddd9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion omr-tracker/files/bin/omr-tracker
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,10 @@ while true; do
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")
OMR_TRACKER_DEVICE_GATEWAY=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | grep kernel | grep -v '.0/' | awk '/proto kernel/ {print $1}' | tr -d "\n")
fi
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ]; then
OMR_TRACKER_DEVICE_GATEWAY=$(ip -4 r list dev "$OMR_TRACKER_DEVICE" | grep -m 1 default | awk '/via/ {print $3}' | tr -d "\n")
fi
fi
if [ "$OMR_TRACKER_IPV6" = "1" ] || [ "$OMR_TRACKER_IPV6" = "auto" ]; then
Expand Down

0 comments on commit 2d6ddd9

Please sign in to comment.