Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to start_tor.sh #16

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion init/down_proxy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/sh
DIR=$( cd "$(dirname "$0")" ; pwd -P )
BASEDIR=$DIR/..
$BASEDIR/scripts/kill.sh delegate
$BASEDIR/scripts/kill.sh haproxy
$BASEDIR/scripts/kill.sh tor
12 changes: 6 additions & 6 deletions init/start_tor.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#!/bin/bash
DIR=$( cd "$(dirname "$0")" ; pwd -P )
BASEDIR=$DIR/..
DELEGATED=/home/scraper/delegate9.9.13/src/delegated
base_socks_port=9050
base_http_port=3128 # leave 3128 for HAProxy
base_control_port=8119
# Create data directory if it doesn't exist
if [ ! -d "data" ]; then
mkdir "data"
fi

if [ ! -d "$BASEDIR/var" ]; then
mkdir "$BASEDIR/var"
fi

#for i in {0..10}
for i in {1..4}
Expand All @@ -23,13 +26,10 @@ do
fi
# Take into account that authentication for the control port is disabled. Must be used in secure and controlled environments

echo "Running: tor --RunAsDaemon 1 --PidFile tor$i.pid --SocksPort $socks_port --DataDirectory $BASEDIR/var/tor$1"

tor --RunAsDaemon 1 --PidFile tor$i.pid --SocksPort $socks_port --DataDirectory $BASEDIR/var/tor$i
echo "Running: tor --RunAsDaemon 1 --PidFile $BASEDIR/var/tor$i/tor$i.pid --SocksPort $socks_port --DataDirectory $BASEDIR/var/tor$1"

echo "Running: ./delegate/src/delegated -P$http_port SERVER=http SOCKS=localhost:$socks_port"
tor --RunAsDaemon 1 --PidFile $BASEDIR/var/tor$i/tor$i.pid --SocksPort $socks_port --DataDirectory $BASEDIR/var/tor$i

$DELEGATED -P$http_port CONNECT=s SERVER=http SOCKS=localhost:$socks_port RELAY=vhost
done

haproxy -f $BASEDIR/etc/rotating-tor-proxies.cfg