mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
28 lines
748 B
Bash
Executable file
28 lines
748 B
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# This script assumes a linux environment
|
|
|
|
TEMPFILE=/tmp/httpsb-asset
|
|
|
|
echo "*** uBlock: updating remote assets..."
|
|
|
|
declare -A assets
|
|
assets=(
|
|
['thirdparties/publicsuffix.org/list/effective_tld_names.dat']='https://publicsuffix.org/list/effective_tld_names.dat'
|
|
)
|
|
|
|
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
|