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/updategoogle.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/updategoogle.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/updategoogle.sh b/scripts/updategoogle.sh new file mode 100755 index 0000000..d446861 --- /dev/null +++ b/scripts/updategoogle.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# stop on errors (nonzero exit codes), uninitialized vars +set -eu + +GOOGLE_DOMAINS_URL=https://www.google.com/supported_domains +MANIFEST_PATH=src/manifest.json +TEMPFILE=$(mktemp) + +trap 'rm $TEMPFILE' EXIT + +echo "fetching Google Search domains ..." +if wget -q -T 30 -O "$TEMPFILE" -- $GOOGLE_DOMAINS_URL && [ -s "$TEMPFILE" ]; then + ./scripts/updategoogle.py "$TEMPFILE" "$MANIFEST_PATH" + if cmp -s "$TEMPFILE" $MANIFEST_PATH; then + echo " no Google Search domain updates" + else + cp "$TEMPFILE" $MANIFEST_PATH + echo " updated Google Search domains in $MANIFEST_PATH" + echo " please verify, update Google's MDFP list, and commit both!" + exit 1 + fi +else + echo " failed to fetch $GOOGLE_DOMAINS_URL" + echo " aborting build!" + exit 1 +fi |