#!/bin/sh # sec1.sh — INSIDE guest 9201 (R-1250 diagnosis, read only): every second, the bytes the throwaway qBittorrent # container sent (its own eth0, inside its netns) and the bytes the guest sent on its LAN eth0 (after the forwarder). N=$1; PID=$(docker inspect -f '{{.State.Pid}}' qbittorrent) i=0; while [ $i -lt $N ]; do c=$(awk '/eth0:/{print $10}' /proc/$PID/net/dev); g=$(cat /sys/class/net/eth0/statistics/tx_bytes) echo "$(date -u +%H:%M:%S) ctr_tx=$c guest_tx=$g"; i=$((i+1)); sleep 1 done