-
-
Save kshji/a5d3dc9929d2a1264c5be16b9752e5f1 to your computer and use it in GitHub Desktop.
Skripti jolla saa Y-tunnuksella kaikki firman omistamat .fi -verkkotunnukset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Y-Tunnukseen perustuva domainejen haku (.fi) | |
## Esimerkki: getdomains 1093944-1 # MTV Oy | |
# Laita tämä .bashrc tai .zshrc | |
# Käyttöesimerkkejä: | |
# Looppaa Y-tunnuksetn kaikki domainit läpi ja tee kysely | |
# for i in $(getdomains 1093944-1); do echo $i && host -t cname www.$i; done | |
function getdomains() { | |
curl 'https://odata.domain.fi/OpenDomainData.svc/Domains()?$orderby=GrantDate%20desc&$top=500&$filter=OrganizationId%20eq%20%27'$1'%27' -s| grep -oP "<d:Name>\K([a-å]+)<"|sed 's/</.fi/g' | |
} | |
# Hae domainiin perustuen: domain_getdomains | |
function domain_getdomains() { | |
CODE=`whois $1|grep -oP "register number(.*): \K(.*)"` | |
getdomains $CODE | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment