#!/bin/sh # qbg.sh [form data] [-F] — INSIDE guest 9201: one call to the throwaway qBittorrent's API from inside its # container. The admin password is read from the container's own env inside the container — never an argument, never printed. P="$1"; D="${2:-}" docker exec -i -e AP="$P" -e AD="$D" qbittorrent sh -s <<'IN' c=/tmp/r1250.c; B=http://localhost:8080 printf 'username=admin&password=%s' "$QBT_ADMIN_PASSWORD" | curl -s -o /dev/null -c $c -H "Referer: $B" --data-binary @- $B/api/v2/auth/login if [ -n "$AD" ]; then curl -s -b $c -H "Referer: $B" --data "$AD" "$B/api/v2/$AP"; else curl -s -b $c -H "Referer: $B" "$B/api/v2/$AP"; fi rm -f $c IN