Created
February 18, 2026 01:20
-
-
Save luckylittle/897bc025adca4b39c0bfee7a6460ce06 to your computer and use it in GitHub Desktop.
In case of IO disk overload and WebUI not accessible, pause all currently active torrents in qBittorrent via shell 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 | |
| # Tested on: | |
| # qBit v5.1.4 | API v2.11.4 | lt 2.0.11.0 | |
| QBT="http://127.0.0.1:8080" | |
| TIMEOUT="300" | |
| # Get JSON from API and extract hashes of all currently active torrents | |
| hashes=$(/usr/bin/curl --connect-timeout ${TIMEOUT} "${QBT}/api/v2/torrents/info?filter=active" | jq -r '.[].hash' | paste -sd '|' -) | |
| [[ -z "${hashes}" ]] && { echo "Hashes is empty!" ; exit 1; } | |
| # Optional: print hashes for verification | |
| echo "Hashes: ${hashes}" | |
| # Call pause API with hashes | |
| /usr/bin/curl -X POST --connect-timeout ${TIMEOUT} "${QBT}/api/v2/torrents/stop" --data-raw "hashes=${hashes}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment