Skip to content

Instantly share code, notes, and snippets.

@gregwym
Created July 28, 2017 06:18
Show Gist options
  • Save gregwym/48c075420e71302be7358100f135cb84 to your computer and use it in GitHub Desktop.
Save gregwym/48c075420e71302be7358100f135cb84 to your computer and use it in GitHub Desktop.
Enable and update blocklists for Synology Download Station
#!/bin/sh
# Script for blocking IP's
# Set path
cd /var/packages/DownloadStation/etc/download/blocklists
# Permissions
chmod 777 ../settings.json
# Edit config file (block)
sed -i -e 's|\(^\s*"blocklist-enabled":\)[^,]*|\1 true|' -e 's|\(^\s*"blocklist-url":\)[^,]*|\1 ""|' ../settings.json
# Obtain block file
wget --content-disposition "http://list.iblocklist.com/?list=ydxerpxkpcfqjaybcssw&fileformat=p2p&archiveformat=gz"
# Extract file
gunzip -f *.gz
# Set time
touch *
# Restart service
/var/packages/DownloadStation/target/scripts/S25download.sh restart
@iFredOS
Copy link

iFredOS commented May 14, 2018

Hi!

I tried to use your script but the log mentioned, this is not working. What can I do to fix this?

[2018-05-14 05:00:04.410] blocklist skipped invalid address at line 2 (blocklist.c:352)

@olbat
Copy link

olbat commented Jul 26, 2020

People looking at this gist might also be interested by this one: https://gist.github.com/olbat/1047463799ab8e617c36698825420bc9 .
It's basically doing the same thing but it makes sure transmissiond's configuration file (settings.json) is not deleted at service's startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment