Skip to content

Instantly share code, notes, and snippets.

@mrphs
Created October 5, 2016 19:34
Show Gist options
  • Save mrphs/1722c853a6a9bc31d3fa34faeddbdeb9 to your computer and use it in GitHub Desktop.
Save mrphs/1722c853a6a9bc31d3fa34faeddbdeb9 to your computer and use it in GitHub Desktop.
Handy script to extract the obfs4 randomly assigned port
#!/bin/bash
TOR_LOG=/var/lib/log/tor/log
OBFS4_PORT=`while read line; do; if [[ $line =~ .*obfs4.*\'\[::\]:([0-9]+).* ]]; then echo "${BASH_REMATCH[1]}"; fi; done < $TOR_LOG`
echo $OBFS4_PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment