Files
docker-transmission/root/defaults/blocklist-update.sh

21 lines
553 B
Bash
Raw Normal View History

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
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
s6-svc -t /var/run/s6/services/transmission
2016-11-02 09:38:19 -04:00
fi
fi
fi