Last active
March 6, 2026 08:28
-
-
Save olbat/1047463799ab8e617c36698825420bc9 to your computer and use it in GitHub Desktop.
Synology DonwloadStation blocklist update script
This file contains hidden or 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/bash | |
| set -euo pipefail | |
| BLOCKLIST_URL='https://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz' | |
| BLOCKLIST_FILE=/var/packages/DownloadStation/etc/download/blocklists/level1 | |
| echo "Clean old blocklist" | |
| rm -f $(dirname $BLOCKLIST_FILE)/* | |
| echo "Download new blocklist" | |
| curl -sSLf --retry 10 --retry-delay 60 --max-time 30 "$BLOCKLIST_URL" \ | |
| | gzip -cd - \ | |
| | sed -e '/^\s*#/d' -e '/^\s*$/d' \ | |
| > $BLOCKLIST_FILE | |
| # patch configuration & service files that might be overwritten after a package update: | |
| # - enable blocklists in transmissiond config file | |
| # - prevent this config file to be deleted by the service's startup script | |
| echo "Patch service files" | |
| sed -i /var/packages/DownloadStation/etc/download/settings.json \ | |
| -e 's/\(^\s*"blocklist-enabled"\s*:\)[^,]*/\1 true/' \ | |
| -e 's/\(^\s*"blocklist-url"\s*:\)[^,]*/\1 ""/' | |
| sed -i /var/packages/DownloadStation/scripts/start-stop-status \ | |
| -e 's|\(^\s*rm .\+/settings.json\s*$\)|#\1|' | |
| echo "Restart DownloadStation" | |
| #synoservicectl --restart pkgctl-DownloadStation | |
| /var/packages/DownloadStation/target/scripts/S25download.sh restart | |
| echo "Verify that the blocklist file was loaded by transmissiond" | |
| sleep 10 # wait for transmissiond to finish starting up | |
| [ -s "$BLOCKLIST_FILE".bin ] \ | |
| || { echo "Missing bin file: blocklist was not loaded by transmissiond"; exit 1; } | |
| # transmissiond logfile: /var/services/download/transmissiond.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
This script still working on "DSM 7.3.2-86009 Update 1" ???
Thanks!
Sorry, I think I wasn't very specific.
I have the same error as @pokemaster974.
The problem being that it worked perfectly until the beginning of November 2025 (I realized the error quite late) in the scheduler, with "root" rights.
Since then it sends me this:
Clean old blocklist
Download new blocklist
Patch service files
Restart DownloadStation
Stopping scheduler...
313 (process ID) old priority -20, new priority -5
active
Update download queue table and set all pid to -1
test upload_rate in download_queue table
test seeders in download_queue table
could not change directory to "/root": Permission denied
Check current amule version...
No need to upgrade amule.conf...
test destination column in download_queue table
test rss_feed table in download db
test uid column in user_setting table
test enable_watchffolder column in user_setting table
test unzip_password column in download_queue table
test unzip_progress column in download_queue table
test is_regex column in rss_filter table
test task_plugin table in download db
test thumbnail table in download db
test thumbnail_status column in download_queue table
test completed_time column in download_queue table
test waiting_until_time column in download_queue table
test colume one in view test_filter_view
test aftertaskdeleted trigger function
could not change directory to "/root": Permission denied
test given_filename, referer, cookie_path column in download_queue table
test torrent_oid column in download_queue table
test notification table in download db
test if notification_view
test task trigger function
could not change directory to "/root": Permission denied
CREATE FUNCTION
could not change directory to "/root": Permission denied
test if function lo_unlink_non_raise is defined
test user preference migration finished
test search_plugin_status table in download db
Starting Download Station scheduler daemon...
Updated /var/services/download/transmissiond/settings.json with values from /var/packages/DownloadStation/etc/settings.conf
313 (process ID) old priority -5, new priority -20
Verify that the blocklist file was loaded by transmission
Missing bin file: blocklist was not loaded by transmission
So permission error also.
Sorry if this is repetitive but I don't see how to do it. Once again it worked very well 3 months ago, and I am delighted with the script!
Thank you so much