1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

No more strange log when no IP defined for VPS

This commit is contained in:
Ycarus 2019-05-14 19:29:29 +02:00
parent 1fced47334
commit d7aa0318c0

View file

@ -78,10 +78,14 @@ _post_tracking() {
_ping_server() {
local serverip=$(uci -q get openmptcprouter.$1.ip)
local deviceip=$2
_ping $serverip $deviceip "yes"
statusp=$?
if $(exit $statusp); then
serverip_ping=true
if [ -n "$serverip" ] && [ -n "$deviceip" ]; then
_ping $serverip $deviceip "yes"
statusp=$?
if $(exit $statusp); then
serverip_ping=true
fi
else
serverip_ping=false
fi
}
@ -182,6 +186,8 @@ while true; do
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then
if [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" = "1" ]; then
OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get glorytun.vpn.remoteip)
else
OMR_TRACKER_DEVICE_GATEWAY=""
fi
fi