1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/bin/sh set -eu TORRC="/var/lib/tor/torrc" # Generate a minimal torrc if none is mounted if [ ! -f "$TORRC" ]; then echo "[tor] No torrc found, generating default..." cat > "$TORRC" <<EOF SocksPort 0.0.0.0:9050 DataDirectory /var/lib/tor Log notice file /var/log/tor/notices.log EOF fi echo "[tor] Starting Tor..." exec tor -f "$TORRC"