mirror of
https://github.com/linuxserver/docker-transmission.git
synced 2025-12-22 16:09:43 +01:00
Merge pull request #18 from phendryx/blocklist-cleanup
Blocklist script cleanup
This commit is contained in:
@@ -1,10 +1,20 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
BLOCKLIST_URL=`jq -r '.["blocklist-url"]' settings.json`
|
BLOCKLIST_ENABLED=`jq -r '.["blocklist-enabled"]' /config/settings.json`
|
||||||
|
BLOCKLIST_URL=`jq -r '.["blocklist-url"]' /config/settings.json | sed 's/\&/\&/g'`
|
||||||
|
|
||||||
rm /config/blocklists/*
|
if [ $BLOCKLIST_ENABLED == true ]; then
|
||||||
cd /config/blocklists
|
mkdir -p /tmp/blocklists
|
||||||
wget -q $BLOCKLIST_URL
|
rm -rf /tmp/blocklists/*
|
||||||
gunzip *.gz
|
cd /tmp/blocklists
|
||||||
chmod go+r *
|
wget -q -O blocklist.gz "$BLOCKLIST_URL"
|
||||||
s6-svc -h /var/run/s6/services/transmission
|
if [ $? == 0 ]; then
|
||||||
|
gunzip *.gz
|
||||||
|
if [ $? == 0 ]; then
|
||||||
|
chmod go+r *
|
||||||
|
rm -rf /config/blocklists/*
|
||||||
|
cp /tmp/blocklists/* /config/blocklists
|
||||||
|
s6-svc -h /var/run/s6/services/transmission
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user