Advertisement
Lajamerr_Mittesdine

update-tld-data.sh | Get TLDs Script

Jun 25th, 2018
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. wget 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' -O tmp1.txt
  4. sed '1d' tmp1.txt > tmp2.txt
  5. sed -e 's/\(.*\)/\L\1/' tmp2.txt > tmp3.txt
  6. sed -n -e '/^xn--/p' tmp3.txt > tmp4.txt
  7. sed 's/^\(xn--\)*//' <tmp4.txt | idn -d > tmp5.txt
  8. cat tmp3.txt tmp5.txt > tmp6.txt
  9. sed -E ':a;N;$!ba;s/\r{0,1}\n/|/g' tmp6.txt > ../resources/tlds.txt
  10. rm tmp*.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement