Skip to content

Commit

Permalink
Fix retrieve IPv6 in some case for OMR-Tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Jan 23, 2024
1 parent fb3cd8b commit 530d89c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion omr-tracker/files/bin/omr-tracker
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ while true; do
if ([ "$OMR_TRACKER_IPV6" = "1" ] || [ "$OMR_TRACKER_IPV6" = "auto" ] || [ -z "$OMR_TRACKER_IPV6" ]) && ([ "$OMR_TRACKER_FAMILY" = "ipv6" ] || [ "$OMR_TRACKER_FAMILY" = "ipv4ipv6" ]); then
#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" | sort -r | grep -m 1 inet6 | awk '{print $2}' | cut -d'/' -s -f1)
OMR_TRACKER_DEVICE_IP6=$(ip -6 addr show dev "$OMR_TRACKER_DEVICE" scope global | sort -r | grep -m 1 inet6 | 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")
Expand Down

0 comments on commit 530d89c

Please sign in to comment.