#!/bin/bash SOCK_PORT=$((9000+$1)) CONTROL_PORT=$((9100+$1)) LOCAL_PORT=$((9200+$1)) DONAR_PORT=$((7000+$1*12)) touch /tmp/empty echo "tor daemon serv" /usr/bin/tor \ -f /tmp/empty --defaults-torrc /tmp/empty \ --hush \ --UseEntryGuards 0 \ --SocksPort 0 \ --ControlPort $CONTROL_PORT \ --DataDirectory /tmp/tor$CONTROL_PORT & sleep 1 echo "tor client serv" /usr/bin/tor \ -f /tmp/empty --defaults-torrc /tmp/empty \ --hush \ --UseEntryGuards 0 \ --SocksPort "127.0.0.1:$SOCK_PORT IsolateDestPort IsolateDestAddr IsolateClientAddr" \ --DataDirectory /tmp/tor$SOCK_PORT & sleep 1 echo "donar serv" rm -rf state_$LOCAL_PORT/ mkdir state_$LOCAL_PORT/ pushd . cd state_$LOCAL_PORT/ /usr/local/bin/donar \ -s \ -a dup2 \ -q $CONTROL_PORT \ -k $DONAR_PORT \ -l 2 \ -e $LOCAL_PORT & sleep 1 echo "donar client" /usr/local/bin/donar \ -c \ -a dup2 \ -q $SOCK_PORT \ -k $DONAR_PORT \ -o ./onion_services.pub \ -l 2 \ -r $LOCAL_PORT & sleep 1 popd echo "measlat serv" /usr/local/bin/measlat \ -l \ -t udp \ -h 127.0.0.1 \ -p $LOCAL_PORT \ -c 135 \ -i 40 \ -s 172 & sleep 1 echo "measlat client bootstrap" /usr/local/bin/measlat \ -t udp \ -h 127.13.3.7 \ -p $LOCAL_PORT \ -b \ -c 1 \ -i 1000 \ -s 172 echo "measlat client collect" /usr/local/bin/measlat \ -t udp \ -h 127.13.3.7 \ -p $LOCAL_PORT \ -c 135 \ -i 40 \ -s 172