blocklist-update.sh 553 B

1234567891011121314151617181920
  1. #!/usr/bin/with-contenv bash
  2. BLOCKLIST_ENABLED=`jq -r '.["blocklist-enabled"]' /config/settings.json`
  3. BLOCKLIST_URL=`jq -r '.["blocklist-url"]' /config/settings.json | sed 's/\&/\&/g'`
  4. if [ $BLOCKLIST_ENABLED == true ]; then
  5. mkdir -p /tmp/blocklists
  6. rm -rf /tmp/blocklists/*
  7. cd /tmp/blocklists
  8. wget -q -O blocklist.gz "$BLOCKLIST_URL"
  9. if [ $? == 0 ]; then
  10. gunzip *.gz
  11. if [ $? == 0 ]; then
  12. chmod go+r *
  13. rm -rf /config/blocklists/*
  14. cp /tmp/blocklists/* /config/blocklists
  15. s6-svc -h /var/run/s6/services/transmission
  16. fi
  17. fi
  18. fi