From 479d768774d1d1ceb6dfa5485545b17b92741f29 Mon Sep 17 00:00:00 2001 From: Lajamerr Mittesdine Date: Mon, 25 Jun 2018 07:45:48 -0400 Subject: [PATCH] Create update-tld-data.sh --- tools/update-tld-data.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tools/update-tld-data.sh diff --git a/tools/update-tld-data.sh b/tools/update-tld-data.sh new file mode 100644 index 000000000..e986d750c --- /dev/null +++ b/tools/update-tld-data.sh @@ -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--\)*//' 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