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

Fix OMR-Tracker when launched without device on interface ready

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-12-22 21:33:51 +01:00
parent 554267c727
commit 0f9be6e08d

View file

@ -6,6 +6,7 @@
. /lib/functions.sh
. /usr/lib/unbound/iptools.sh
. /lib/functions/network.sh
# retrieve args
OMR_TRACKER_INTERFACE="$1"
@ -246,6 +247,14 @@ while true; do
OMR_TRACKER_DEVICE_GATEWAY=
OMR_TRACKER_DEVICE_GATEWAY6=
serverip_ping=false
[ -z "$OMR_TRACKER_DEVICE" ] && {
network_get_device OMR_TRACKER_DEVICE $OMR_TRACKER_INTERFACE
[ -z "$OMR_TRACKER_DEVICE" ] && network_get_physdev OMR_TRACKER_DEVICE $1
[ -z "$OMR_TRACKER_DEVICE" ] && OMR_TRACKER_DEVICE=$(ifstatus "$1" | jsonfilter -q -e '@["l3_device"]')
[ -z "$OMR_TRACKER_DEVICE" ] && OMR_TRACKER_DEVICE=$(ifstatus "$1_4" | jsonfilter -q -e '@["l3_device"]')
[ -z "$OMR_TRACKER_DEVICE" ] && config_get OMR_TRACKER_DEVICE "$1" device
[ -n "$(echo $OMR_TRACKER_DEVICE | grep '@')" ] && OMR_TRACKER_DEVICE=$(ifstatus "$1" | jsonfilter -q -e '@["device"]')
}
if [ -n "$OMR_TRACKER_DEVICE" ] && [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
if [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep UP)" ]; then