Assorted shell and Python scripts

Check for DHT nodes

Changed files
+2 -2
+2 -2
qbittorrent_state
···
set -euo pipefail
-
if ! curl -s "http://${1}:8080/api/v2/torrents/info" | jq . | grep "state" | grep "downloading"; then
-
curl -d "No active downloads" http://localhost:8080/qbittorrent_state
+
if [ "$(curl -s "http://${1}:8080/api/v2/transfer/info" | jq '.dht_nodes')" = "0" ]; then
+
curl -d "0 DHT nodes" http://localhost:8080/qbittorrent_state
fi