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:
parent
1fced47334
commit
d7aa0318c0
1 changed files with 10 additions and 4 deletions
|
@ -78,11 +78,15 @@ _post_tracking() {
|
||||||
_ping_server() {
|
_ping_server() {
|
||||||
local serverip=$(uci -q get openmptcprouter.$1.ip)
|
local serverip=$(uci -q get openmptcprouter.$1.ip)
|
||||||
local deviceip=$2
|
local deviceip=$2
|
||||||
|
if [ -n "$serverip" ] && [ -n "$deviceip" ]; then
|
||||||
_ping $serverip $deviceip "yes"
|
_ping $serverip $deviceip "yes"
|
||||||
statusp=$?
|
statusp=$?
|
||||||
if $(exit $statusp); then
|
if $(exit $statusp); then
|
||||||
serverip_ping=true
|
serverip_ping=true
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
serverip_ping=false
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_ping() {
|
_ping() {
|
||||||
|
@ -182,6 +186,8 @@ while true; do
|
||||||
if [ -z "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$OMR_TRACKER_DEVICE_GATEWAY" = "0.0.0.0" ]; then
|
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
|
if [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ] && [ "$(uci -q get glorytun.vpn.enable)" = "1" ]; then
|
||||||
OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get glorytun.vpn.remoteip)
|
OMR_TRACKER_DEVICE_GATEWAY=$(uci -q get glorytun.vpn.remoteip)
|
||||||
|
else
|
||||||
|
OMR_TRACKER_DEVICE_GATEWAY=""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue