diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2024-02-20 11:51:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 11:51:58 +0100 |
commit | 12e142565ea9b42260808a5269c3cf8bf1978721 (patch) | |
tree | e5db27812f4bce53d0eb3b1d0c594916ec994306 /utils/public_suffix_list_download.sh | |
parent | 2f814c526b75ae9beb23e409376705f130f0228e (diff) |
Add a script to download/update the domain suffix list (#2321)
Diffstat (limited to 'utils/public_suffix_list_download.sh')
-rwxr-xr-x | utils/public_suffix_list_download.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/utils/public_suffix_list_download.sh b/utils/public_suffix_list_download.sh new file mode 100755 index 000000000..68be5bcbb --- /dev/null +++ b/utils/public_suffix_list_download.sh @@ -0,0 +1,17 @@ +#!/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 |