diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 05:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 05:47:55 +0000 |
commit | 31d6ff6f931696850c348007241195ab3b2eddc7 (patch) | |
tree | 615cb1c57ce9f6611bad93326b9105098f379609 /uAssets/tools/update-3rdparties.sh | |
parent | Initial commit. (diff) | |
download | ublock-origin-31d6ff6f931696850c348007241195ab3b2eddc7.tar.xz ublock-origin-31d6ff6f931696850c348007241195ab3b2eddc7.zip |
Adding upstream version 1.55.0+dfsg.upstream/1.55.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'uAssets/tools/update-3rdparties.sh')
-rwxr-xr-x | uAssets/tools/update-3rdparties.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/uAssets/tools/update-3rdparties.sh b/uAssets/tools/update-3rdparties.sh new file mode 100755 index 0000000..f007c0c --- /dev/null +++ b/uAssets/tools/update-3rdparties.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# +# This script assumes a linux environment + +TEMPFILE=$(mktemp) + +echo "*** uAssets: updating remote assets..." + +declare -A assets +assets=( + ['thirdparties/pgl.yoyo.org/as/serverlist']='https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&startdate%5Bday%5D=&startdate%5Bmonth%5D=&startdate%5Byear%5D=&mimetype=plaintext' + ['thirdparties/publicsuffix.org/list/effective_tld_names.dat']='https://publicsuffix.org/list/public_suffix_list.dat' + ['thirdparties/urlhaus-filter/urlhaus-filter-online.txt']='https://malware-filter.gitlab.io/urlhaus-filter/urlhaus-filter-online.txt' +) + +for i in "${!assets[@]}"; do + localURL="$i" + remoteURL="${assets[$i]}" + echo "*** Downloading ${remoteURL}" + if wget -q -T 30 -O "$TEMPFILE" -- "$remoteURL"; then + if [ -s "$TEMPFILE" ]; then + if ! cmp -s "$TEMPFILE" "$localURL"; then + echo " New version found: ${localURL}" + if [ "$1" != "dry" ]; then + mv "$TEMPFILE" "$localURL" + fi + fi + fi + fi +done |