2018-06-30 17:01:23 -06:00
|
|
|
#!/bin/bash
|
|
|
|
BASE=$(dirname "$0")
|
2018-08-17 20:14:55 -06:00
|
|
|
if [ -f "$1" ]; then
|
|
|
|
cp "$1" "$BASE/tld_template.js"
|
|
|
|
fi
|
2018-06-30 17:01:23 -06:00
|
|
|
pushd "$BASE"
|
|
|
|
fname=public_suffix_list.dat
|
|
|
|
nflag=""
|
2018-08-01 17:50:09 -06:00
|
|
|
if [ -f "$fname" ]; then
|
2018-06-30 17:01:23 -06:00
|
|
|
nflag="-z $fname"
|
|
|
|
fi
|
|
|
|
URL=https://publicsuffix.org/list/$fname
|
|
|
|
curl -O $nflag "$URL"
|
|
|
|
|
2018-08-01 17:50:09 -06:00
|
|
|
if ! grep 'com' "$fname" >/dev/null; then
|
2018-06-30 17:01:23 -06:00
|
|
|
echo >&2 "$fname empty or corrupt!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
./generate.pl
|
|
|
|
popd
|