Skip to content

Commit

Permalink
Use whois timeout in omr-tracker post-tracking status script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Jan 27, 2025
1 parent ab3cbb9 commit 0f0be7c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion omr-tracker/files/usr/share/omr/post-tracking.d/020-status
Original file line number Diff line number Diff line change
Expand Up @@ -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)" ] && {
Expand Down

0 comments on commit 0f0be7c

Please sign in to comment.