自建IP查询,域名curlip.me

  • A+
所属分类:随手小记
摘要

以前一直用其他地方公开的IP库来做查询,单数输出格式很不方便,于是产生了这个自建的客户端IP反馈站点。

curlip.me

www.curlip.me

[root@Legion100 ~]# curl -4s curlip.me | awk 'NR==1{print $2}'
183.131.105.175
#单独获取IP
[root@Legion100 ~]# curl -4s curlip.me | awk 'NR==2{print $2}'
中国浙江省温州市电信
#单独获取IP归属地
[root@Legion100 ~]# curl -4s curlip.me | awk 'NR==3{$1="";print gensub(/^[ ]+/,"",1)}'
curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
[root@Legion100 ~]# curl -4s curlip.me | awk 'NR<=2{$1="";print gensub(/^[ ]+/,"",1)}'  183.131.105.175 中国浙江省温州市电信 #获取IP和归属地  [root@Legion100 ~]# curl -4s curlip.me | awk 'NR>=2{$1="";print gensub(/^[ ]+/,"",1)}'
中国浙江省温州市电信
curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
#获取归属地和useragent
[root@Legion100 ~]# curl -4s curlip.me | awk 'NR~/1|3/{$1="";print gensub(/^[ ]+/,"",1)}'
183.131.105.175
curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
#获取IP和useragent
[root@Legion100 ~]# 

自建IP查询,域名curlip.me

lookback

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: