#!/bin/sh # qbsec.sh — INSIDE guest 9201 (R-1250 diagnosis, read only): each second, qBittorrent's own view of the global # upload limit (transfer/info up_rate_limit and preferences up_limit) and its upload speed. i=0; while [ $i -lt $1 ]; do T=$(sh /root/r1250/qbg.sh transfer/info); P=$(sh /root/r1250/qbg.sh app/preferences) printf '%s %s %s\n' "$(date -u +%H:%M:%S)" "$(echo "$T" | python3 -c 'import json,sys;d=json.load(sys.stdin);print("rate_limit=%s up_speed=%.2fMbit" % (d.get("up_rate_limit"), d.get("up_info_speed",0)*8/1e6))' 2>&1)" "$(echo "$P" | python3 -c 'import json,sys;d=json.load(sys.stdin);print("pref_up_limit=%s" % d.get("up_limit"))' 2>&1)" i=$((i+1)) done