haraka/haraka-tld

View on GitHub
update_tld_files

Summary

Maintainability
Test Coverage
#!/bin/bash
# Update Haraka TLD files

CURL=$(which curl 2>/dev/null)

if [ $? -ne 0 ]; then
    echo "Error: curl not found"
    exit 1
fi

$CURL -f -s -S -o - https://publicsuffix.org/list/effective_tld_names.dat | grep -v '^$' | grep -v '^//' > etc/public-suffix-list

$CURL -f -s -S -o etc/top-level-tlds https://data.iana.org/TLD/tlds-alpha-by-domain.txt
$CURL -f -s -S -o etc/two-level-tlds https://surbl.org/static/two-level-tlds
$CURL -f -s -S -o etc/three-level-tlds https://surbl.org/static/three-level-tlds
$CURL -f -s -S -o etc/extra-tlds https://rss.uribl.com/hosters/hosters.txt