mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Get public ip only if IPv4/IPv6 set on interface
This commit is contained in:
parent
c80f9a017a
commit
01d9b7efc1
1 changed files with 4 additions and 2 deletions
|
@ -970,9 +970,11 @@ fi
|
|||
# Save wan settings for status page
|
||||
if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($(date +"%s") + $((30 + RANDOM % 31)) - $(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc))) -gt 3600 ] || [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.state)" = "down" ]; then
|
||||
[ "$(uci -q get openmptcprouter.settings.debug)" = "true" ] && _log "Get status and settings for $OMR_TRACKER_INTERFACE..."
|
||||
local ipaddr=""
|
||||
local ip6addr=""
|
||||
if [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ] && [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.vpn)" != "1" ]; then
|
||||
local ipaddr="$(omr-ip-intf $OMR_TRACKER_DEVICE)"
|
||||
local ip6addr="$(omr-ip6-intf $OMR_TRACKER_DEVICE)"
|
||||
[ -n "$OMR_TRACKER_DEVICE_IP" ] && ipaddr="$(omr-ip-intf $OMR_TRACKER_DEVICE)"
|
||||
[ -n "$OMR_TRACKER_DEVICE_IP6" ] && ip6addr="$(omr-ip6-intf $OMR_TRACKER_DEVICE)"
|
||||
else
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s")
|
||||
uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state="up"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue