1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00

Fix tracker on down interface

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-01-15 10:27:29 +01:00
parent 5074d855f0
commit f10191f25b

View file

@ -271,7 +271,7 @@ while true; do
}
if [ -n "$OMR_TRACKER_DEVICE" ] && [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
if [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep UP)" ]; then
if [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep 'state UP')" ]; then
# retrieve iface ip and gateway
if ([ "$OMR_TRACKER_FAMILY" = "ipv4" ] || [ "$OMR_TRACKER_FAMILY" = "ipv4ipv6" ]) && [ "$OMR_TRACKER_INTERFACE_PROTO" != "dhcpv6" ]; then
OMR_TRACKER_DEVICE_IP=$(ip -4 -br addr ls dev "$OMR_TRACKER_DEVICE" | awk -F'[ /]+' '{print $3}')