mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Create update-tld-data.sh
This commit is contained in:
parent
3663732cd2
commit
479d768774
1 changed files with 10 additions and 0 deletions
10
tools/update-tld-data.sh
Normal file
10
tools/update-tld-data.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
wget 'https://data.iana.org/TLD/tlds-alpha-by-domain.txt' -O tmp1.txt
|
||||
sed '1d' tmp1.txt > tmp2.txt
|
||||
sed -e 's/\(.*\)/\L\1/' tmp2.txt > tmp3.txt
|
||||
sed -n -e '/^xn--/p' tmp3.txt > tmp4.txt
|
||||
sed 's/^\(xn--\)*//' <tmp4.txt | idn -d > tmp5.txt
|
||||
cat tmp3.txt tmp5.txt > tmp6.txt
|
||||
sed -E ':a;N;$!ba;s/\r{0,1}\n/|/g' tmp6.txt > ../resources/tlds.txt
|
||||
rm tmp*.txt
|
Loading…
Reference in a new issue