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

Use whois timeout in omr-tracker post-tracking status script

This commit is contained in:
Ycarus (Yannick Chabanois) 2025-01-27 19:33:47 +01:00
parent ab3cbb9a48
commit 0f0be7c8ca

View file

@ -50,7 +50,9 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && { [ "$(uci -q get openmptcprouter.$OMR_TRA
if [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ]; then
#asn="$(wget -4 -qO- -T 4 http://api.iptoasn.com/v1/as/ip/$ipaddr | jsonfilter -q -e '@.as_description')"
#[ -z "$asn" ] && {
asn="$(timeout 2 whois $ipaddr 2>/dev/null | grep -m 1 -i 'netname' | awk '{print $2}')"
whoistimeout=$(uci -q get openmptcprouter.settings.status_whois_timeout)
[ -z "$whoistimeout" ] && whoistimeout=2
asn="$(timeout $whoistimeout whois $ipaddr 2>/dev/null | grep -m 1 -i 'netname' | awk '{print $2}')"
#}
fi
[ -z "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE)" ] && {