uBlock/assets/update-3rdparties.sh
gorhill 60a88c8bed changes for #602 + updated out-of-the-box 3rd-party assets
- When #602 is completely fixed, the only filter lists packaged with the
  extension will be those which are selected by default out-of-the-box. So
  scripts to update 3rd-party assets have been changed for this.
- Removed "bad" filter lists:
    - "ESP: Filtros Nauscopicos": no longer maintained
    - "ROU: RO-LIST": contains questionable exception filters.
      (See: https://github.com/chrisaljoudi/uBlock/issues/693)
2015-08-17 09:15:41 -04:00

33 lines
1.4 KiB
Bash
Executable file

#!/bin/bash
#
# This script assumes a linux environment
TEMPFILE=/tmp/ublock-asset
echo "*** uBlock: updating remote assets..."
declare -A assets
assets=(
['thirdparties/easylist-downloads.adblockplus.org/easylist.txt']='https://easylist-downloads.adblockplus.org/easylist.txt'
['thirdparties/easylist-downloads.adblockplus.org/easyprivacy.txt']='https://easylist-downloads.adblockplus.org/easyprivacy.txt'
['thirdparties/mirror1.malwaredomains.com/files/justdomains']='http://mirror1.malwaredomains.com/files/justdomains'
['thirdparties/pgl.yoyo.org/as/serverlist']='http://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/effective_tld_names.dat'
['thirdparties/www.malwaredomainlist.com/hostslist/hosts.txt']='http://www.malwaredomainlist.com/hostslist/hosts.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