Assorted shell and Python scripts

Print number of DHT nodes

Changed files
+2 -3
+2 -3
qbittorrent_state
···
set -euo pipefail
-
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
+
DHT_NODES=$(curl -s "http://${1}:8080/api/v2/transfer/info" | jq '.dht_nodes')
+
curl -d "${DHT_NODES} nodes" http://localhost:8080/qbittorrent_state