summaryrefslogtreecommitdiffstats
path: root/src/mk-knowntlds.sh
blob: bfb6193f20ffa0c27583b4538eb2b8d28a80a25a (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh -e

echo "/* autogenerated by mk-knowntlds.sh at `date --iso-8601=seconds -u` */"
echo "static const char* KnownTLDS_static[] = {"
echo "\".\","
(
  curl https://data.iana.org/TLD/tlds-alpha-by-domain.txt || \
  wget -O - https://data.iana.org/TLD/tlds-alpha-by-domain.txt
) | grep -v '^#' | awk '{print "\"" tolower($1) "\","}'
echo "0 };"