diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 19:47:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 19:47:39 +0000 |
commit | 8d13bdc6cac0e20c43c6f909fc0208774b9c5c84 (patch) | |
tree | 5fd46925c6b4a881c9208772ed8e5cc0588bc164 /scripts/updatepsl.sh | |
parent | Initial commit. (diff) | |
download | privacybadger-8d13bdc6cac0e20c43c6f909fc0208774b9c5c84.tar.xz privacybadger-8d13bdc6cac0e20c43c6f909fc0208774b9c5c84.zip |
Adding upstream version 2020.10.7.upstream/2020.10.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | scripts/updatepsl.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/updatepsl.sh b/scripts/updatepsl.sh new file mode 100755 index 0000000..fa91741 --- /dev/null +++ b/scripts/updatepsl.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# Update the Public Suffix List (psl) + +# stop on errors (nonzero exit codes), uninitialized vars +set -eu + +PSL_PATH=src/lib/publicSuffixList.js +PSL_URL=https://publicsuffix.org/list/public_suffix_list.dat +TEMPFILE=$(mktemp) + +trap 'rm $TEMPFILE' EXIT + +echo "fetching Public Suffix List ..." +if wget -q -T 30 -O "$TEMPFILE" -- $PSL_URL && [ -s "$TEMPFILE" ]; then + python scripts/convertpsl.py "$TEMPFILE" + if cmp -s "$TEMPFILE" $PSL_PATH; then + echo " no PSL updates" + else + cp "$TEMPFILE" $PSL_PATH + echo " updated PSL at $PSL_PATH" + echo " please verify and commit!" + exit 1 + fi +else + echo " failed to fetch PSL from $PSL_URL" + echo " aborting build!" + exit 1 +fi |