aboutsummaryrefslogtreecommitdiff
path: root/utils/public_suffix_list_download.sh
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-02-20 11:51:58 +0100
committerGitHub <noreply@github.com>2024-02-20 11:51:58 +0100
commit12e142565ea9b42260808a5269c3cf8bf1978721 (patch)
treee5db27812f4bce53d0eb3b1d0c594916ec994306 /utils/public_suffix_list_download.sh
parent2f814c526b75ae9beb23e409376705f130f0228e (diff)
Add a script to download/update the domain suffix list (#2321)
Diffstat (limited to 'utils/public_suffix_list_download.sh')
-rwxr-xr-xutils/public_suffix_list_download.sh17
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