From c5acab5e90628a7cf5fc02a69135a7539fc1970b Mon Sep 17 00:00:00 2001 From: Xiao Pan Date: Sun, 13 Jul 2025 22:04:44 +0800 Subject: upd: clean code about studio --- sh/upd | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'sh') diff --git a/sh/upd b/sh/upd index 4a20aac..32a668e 100755 --- a/sh/upd +++ b/sh/upd @@ -304,14 +304,12 @@ monthly_misc () { # https://github.com/qbittorrent/qBittorrent/wiki#webui-api curl -sS -X POST 'ibwg:57151/api/v2/search/updatePlugins' & - # in the past, I have both stwg and ibwg, now only one but I decided to keep the code - for qbt_wireguard_host in ibwg; do - # another way: `jq -r '.[]|"\(.added_on)\t\(.hash)\t\(.name)"'` - curl -sS "$qbt_wireguard_host:57151/api/v2/torrents/info?category=useful" | jq -r '.[]|[.added_on,.hash,.name]|@tsv' | grep 'archlinux.*\.iso' | sort -n | head -n-1 | awk '{print $2}' | while read -r hash; do - # need POST to delete torrents. -d default POST, so no need `-X POST` - curl -sS -d "hashes=$hash" -d deleteFiles=true "$qbt_wireguard_host:57151/api/v2/torrents/delete" - done & - done + # in the past, I have both stwg and ibwg, now only one + # another way: `jq -r '.[]|"\(.added_on)\t\(.hash)\t\(.name)"'` + curl -sS 'ibwg:57151/api/v2/torrents/info?category=useful' | jq -r '.[]|[.added_on,.hash,.name]|@tsv' | grep 'archlinux.*\.iso' | sort -n | head -n-1 | awk '{print $2}' | while read -r hash; do + # need POST to delete torrents. -d default POST, so no need `-X POST` + curl -sS -d "hashes=$hash" -d deleteFiles=true 'ibwg:57151/api/v2/torrents/delete' + done & wait while ! [ -d /run/media/xyz/Ventoy ]; do -- cgit v1.2.3-70-g09d2