Skip to content

Commit

Permalink
Add a script to download/update the domain suffix list
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNardi committed Feb 19, 2024
1 parent e93bcfd commit 6b33d5b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions utils/public_suffix_list_download.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions utils/update_every_lists.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ RETVAL=$(( RETVAL + $? ))
RETVAL=$(( RETVAL + $? ))
./protonvpn_ip_addresses_download.sh
RETVAL=$(( RETVAL + $? ))
./public_suffix_list_download.sh
RETVAL=$(( RETVAL + $? ))

test ${RETVAL} -ne 0 && printf '%s: %s\n' "${0}" "${RETVAL} script(s) failed"
exit ${RETVAL}

0 comments on commit 6b33d5b

Please sign in to comment.