Created
July 28, 2017 06:18
-
-
Save gregwym/48c075420e71302be7358100f135cb84 to your computer and use it in GitHub Desktop.
Enable and update blocklists for Synology Download Station
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
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
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)