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:
parent
554267c727
commit
0f9be6e08d
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue