mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 02:51:50 +00:00
Check if interface is up before ping
This commit is contained in:
parent
6f5b9ded1c
commit
96fda4b460
1 changed files with 1 additions and 1 deletions
|
@ -178,7 +178,7 @@ while true; do
|
|||
OMR_TRACKER_DEVICE_GATEWAY=
|
||||
serverip_ping=false
|
||||
|
||||
if [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ]; then
|
||||
if [ -d "/sys/class/net/$OMR_TRACKER_DEVICE" ] && [ -n "$(ip link show $OMR_TRACKER_DEVICE | grep UP)" ]; then
|
||||
# retrieve iface ip and gateway
|
||||
OMR_TRACKER_DEVICE_IP=$(ip -4 -br addr ls dev "$OMR_TRACKER_DEVICE" | awk -F'[ /]+' '{print $3}')
|
||||
if [ -z "$OMR_TRACKER_DEVICE_IP" ]; then
|
||||
|
|
Loading…
Reference in a new issue