This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tornade: use existing tor daemon if available

+17
+17
tools/tornade/tornade.sh
··· 1 1 #!/usr/bin/env bash 2 2 set -euo pipefail 3 3 4 + # Check for existing Tor daemon (env var or default port 9050) 5 + EXISTING_TOR_PORT="${TOR_SOCKS_PORT:-9050}" 6 + if nc -z 127.0.0.1 "$EXISTING_TOR_PORT" 2>/dev/null; then 7 + # Use existing Tor daemon - no startup/cleanup needed 8 + export TORSOCKS_TOR_PORT=$EXISTING_TOR_PORT 9 + if [[ "$(uname)" == "Darwin" ]]; then 10 + if [[ "$1" == "ssh" ]]; then 11 + shift 12 + exec ssh -o ProxyCommand="nc -x 127.0.0.1:$EXISTING_TOR_PORT %h %p" "$@" 13 + else 14 + exec torsocks "$@" 15 + fi 16 + else 17 + exec torsocks "$@" 18 + fi 19 + fi 20 + 4 21 # Create temporary directory for this tor instance 5 22 TOR_DIR=$(mktemp -d -t tornade.XXXXXX) 6 23