2016-10-18 08:41:49 -04:00
|
|
|
#!/usr/bin/with-contenv bash
|
|
|
|
|
|
2016-11-03 07:12:13 -04:00
|
|
|
BLOCKLIST_ENABLED=`jq -r '.["blocklist-enabled"]' /config/settings.json`
|
|
|
|
|
BLOCKLIST_URL=`jq -r '.["blocklist-url"]' /config/settings.json | sed 's/\&/\&/g'`
|
2016-10-18 08:41:49 -04:00
|
|
|
|
2016-11-02 09:39:55 -04:00
|
|
|
if [ $BLOCKLIST_ENABLED == true ]; then
|
|
|
|
|
mkdir -p /tmp/blocklists
|
|
|
|
|
rm -rf /tmp/blocklists/*
|
|
|
|
|
cd /tmp/blocklists
|
2016-11-02 10:04:54 -04:00
|
|
|
wget -q -O blocklist.gz "$BLOCKLIST_URL"
|
2016-11-02 09:38:19 -04:00
|
|
|
if [ $? == 0 ]; then
|
|
|
|
|
gunzip *.gz
|
|
|
|
|
if [ $? == 0 ]; then
|
|
|
|
|
chmod go+r *
|
2016-11-02 09:39:55 -04:00
|
|
|
rm -rf /config/blocklists/*
|
2016-11-02 09:38:19 -04:00
|
|
|
cp /tmp/blocklists/* /config/blocklists
|
2019-07-19 20:04:55 -07:00
|
|
|
s6-svc -t /var/run/s6/services/transmission
|
2016-11-02 09:38:19 -04:00
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|