bettercap/vendor/github.com/jpillora/go-tld/generate.sh
2018-03-23 15:25:11 +01:00

27 lines
534 B
Bash

#!/bin/sh
#pull the official TLD list, remove comments and blanks, reverse each line, then sort
words=`curl -# https://www.publicsuffix.org/list/effective_tld_names.dat |
grep -v "^//" |
grep -v "^\$" |
grep -v "^!" |
grep -v "^*" |
rev |
sort`
#convert each line into Go strings
strings=`for w in $words; do
echo " \"$w\","
done`
#output the generated file
echo "package tld
//generated on '`date -u`'
//list contains all TLDs reversed, then sorted
var list = []string{
$strings
}
var count = len(list)
" > parse_list.go