This repository has no description
0

Configure Feed

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

tools.tornade: check if logfile actually exists

+9 -1
+9 -1
tools/tornade/tornade.sh
··· 58 58 59 59 # Check frequently at first, then slow down - longer timeout per attempt 60 60 for i in {1..120}; do 61 - if grep -q "Bootstrapped 100%" "$TOR_DIR/tor.log" 2>/dev/null; then 61 + # Check if log file exists and contains the success message 62 + if [ -f "$TOR_DIR/tor.log" ] && grep -q "Bootstrapped 100%" "$TOR_DIR/tor.log" 2>/dev/null; then 62 63 # Success - exit both loops 63 64 break 2 65 + fi 66 + # If log file doesn't exist after 2 seconds, tor likely failed to start 67 + if [ "$i" -eq 20 ] && [ ! -f "$TOR_DIR/tor.log" ]; then 68 + # Log file wasn't created after 2 seconds - tor likely failed completely 69 + # Exit with failure immediately rather than retrying 70 + break 64 71 fi 65 72 # Check every 0.1s for first 2 seconds, then every 0.5s 66 73 if [ "$i" -le 20 ]; then ··· 99 106 100 107 # Execute the command 101 108 export TORSOCKS_TOR_PORT=$SOCKS_PORT 109 + export TOR_CONTROL_PORT=$CONTROL_PORT 102 110 exec torsocks "$@"