repo.or.cz
/
hband-tools.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
make getpeername() return the original socket address which before it was intercepted
[hband-tools.git]
/
user-tools
/
digasn
blob
8eabe5393bc0c7b522e96dc15aad8b7902c3a824
1
#!/bin/bash
2
3
true
<<EOF
4
=pod
5
6
=head1 NAME
7
8
digasn - Query Autonom System Number (ASN) from DNS
9
10
=cut
11
12
EOF
13
14
15
if
[
"
$1
"
-gt
0
]
2
>/
dev
/
null
16
then
17
dig
+
short txt AS
$1
.asn.cymru.com
18
else
19
dig
+
short txt $
(
tr
.
"
\n
"
<<<
"
$1
"
|
tac
|
tr
"
\n
"
.
)
origin.asn.cymru.com
20
fi