PuRiCeL Posted January 14, 2012 Report Share Posted January 14, 2012 (edited) Am vazut pe forum ca se tot vand nologine si m-am gandit sa fac un script care sa zica ce tara sunt.Avem asa: cat go#!/bin/bash # wn nologin geoip scripts.# cat $1 |replace " " ":" |replace ":|:no:host" "" >afor x in `cat a`doecho $x | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' >ipLINE=`cat ip`IP=`lynx -dump "http://www.geoiptool.com/en/?IP=$LINE" | sed -n '/Host Name/,/Postal code/p'`COUNTRY=`echo "$IP" | awk 'BEGIN { FS = "\n" ; RS = "" } { print $4 }' | awk '{print $3}'`CITY=`echo "$IP" | awk 'BEGIN { FS = "\n" ; RS = "" } { print $5 }' | sed -e 's/\(Region:\|Region:.\[15\]\)//g'`echo "$x | $COUNTRY $CITY"echo "$x | $COUNTRY $CITY" >>geoip.listdonePentru cei mai inceti: - lista de nologine trebuie sa arate asa: guest guest 157.253.220.11 | no hostgames games 174.115.61.107 | no hostuser user 174.115.61.107 | no hostgames games 174.117.5.128 | no hostguest guest 174.115.61.107 | no host- ./go nobash.txt- nobash.txt este lista ta cu nologine. Edited January 14, 2012 by PuRiCeL Quote Link to comment Share on other sites More sharing options...
doiulyka Posted February 28, 2012 Report Share Posted February 28, 2012 Foarte folositor si multumesc.. acum daca te rog si ai putin timp.. pe geoip afiseaza asa:Host Name: adsl-68-19-183-202.jan.bellsouth.net IP Address: 68.19.183.202 Country: United States Country code: US (USA) Region: Mississippi City: Flowood Postal code: 39232 ----------------------------Ai putea modifica putin sa salveze si orasul si ZIP-ul pentru cele de usa?gen: user:user:68.19.183.202 | US, Mississippi, Flowood, 39232.Aveam facut de cineva in php.. cu CURL dar l-am pierdut si m-ar ajuta foarte mult daca le-ar salva asa. Quote Link to comment Share on other sites More sharing options...
waingro Posted February 28, 2012 Report Share Posted February 28, 2012 fara sa fac offtopic, sau sa minimalizez munca OP, cel mai exact geoip de pe planeta asta este cel de la MaxMind - GeoIP | IP Address Locator Demoeste singura companie care lucreaza cu toate procesoarele de orice fel, sa si protejeze clientii de frauda din orice domeniu.si este axata numai pe acest lucru. 1 Quote Link to comment Share on other sites More sharing options...
Zatarra Posted February 28, 2012 Report Share Posted February 28, 2012 fara sa fac offtopic, sau sa minimalizez munca OP, cel mai exact geoip de pe planeta asta este cel de la MaxMind - GeoIP | IP Address Locator Demoeste singura companie care lucreaza cu toate procesoarele de orice fel, sa si protejeze clientii de frauda din orice domeniu.si este axata numai pe acest lucru.Exista vreo solutie fara sa cumperi? Quote Link to comment Share on other sites More sharing options...
Vlachs Posted February 28, 2012 Report Share Posted February 28, 2012 Exista vreo solutie fara sa cumperi?Este varianta free MaxMind - GeoLite Country | Open Source IP Address to Country Database Quote Link to comment Share on other sites More sharing options...