Files
S_New4/docker-entry.sh

26 lines
417 B
Bash

#!/bin/bash
MAX_RETRIES=100
INTERVAL=0.1
# Start tor service
tor > /dev/null &
# Wait until finished
for i in $(seq 1 $MAX_RETRIES); do
if nc -z localhost 9050 > /dev/null 2>&1; then
break
fi
sleep $INTERVAL
# Check if the maximum number of retries has been reached
if [ $i -eq $MAX_RETRIES ]; then
echo "Error: Timed out waiting for Tor to start"
exit 1
fi
done
# Run SNew4
S_New4 "$@"