aboutsummaryrefslogtreecommitdiff
path: root/utils/public_suffix_list_download.sh
blob: 20fd39747c290df653a95700675eab811f994182 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env bash
set -e

cd "$(dirname "${0}")" || exit 1
. ./common.sh || exit 1

LIST=../lists/public_suffix_list.dat

printf '(1) %s\n' "Getting domain suffix list"
DOMAINS="$(curl -s 'https://publicsuffix.org/list/public_suffix_list.dat')"
is_str_empty "${DOMAINS}" "Please check the URL."

echo "${DOMAINS}" > ${LIST}

printf '(3) %s\n' "List ${LIST} is now ready"
exit 0