1

I found this script

#!/bin/bash

usage() { echo "Usage: $0 [-n <number of copies>] [-p <path to default TBB>]" 1>&2; exit 1; }

print_userjs(){
  local socksport=${1}
  local controlport=${2}
  local dest=${3}
  echo "user_pref(\"extensions.torlauncher.control_port\",$controlport);" > $dest
  echo "user_pref(\"extensions.torbutton.custom.socks_port\",$socksport);" >> $dest
  echo "user_pref(\"extensions.torbutton.custom.socks_host\",\"127.0.0.1\");" >> $dest
  echo "user_pref(\"extensions.torbutton.proxies_applied\",false);" >> $dest
  echo "user_pref(\"extensions.torbutton.use_privoxy\",false);" >> $dest
  echo "user_pref(\"network.proxy.socks_port\",$socksport);" >> $dest
}

while getopts ":n:p:" o; do
  case "${o}" in
    n)
      n=${OPTARG}
      ;;
    p)
      p=${OPTARG}
      ;;
    *)
      usage
      exit 0
     ;;
  esac
done
if [ -z "$n" ] || [ -z "$p" ];
then
  usage
  exit 0
fi
for i in `seq 1 $n`;
do
  CONTROL_PORT=$((9151+$i*2))
  SOCKS_PORT=$((9150+$i*2)) 
  echo "$i) Copying $p to TBB$i"
  cp -r $p TBB$i
  echo "$i) Creating user.js with SocksPort $SOCKS_PORT and ControlPort $CONTROL_PORT"
  print_userjs $SOCKS_PORT $CONTROL_PORT "./TBB$i/Browser/TorBrowser/Data/Browser/profile.default/user.js"
  echo "$i) Modifying torrc-default"
  TORRC="./TBB$i/Browser/TorBrowser/Data/Tor/torrc-defaults"
  sed -i "s/SocksPort 9150/SocksPort $SOCKS_PORT/g" $TORRC 
  sed -i "s/ControlPort 9151/ControlPort $CONTROL_PORT/g" $TORRC
done

But when I run it, it just generates a simple file.

And the default path to TBB is " C:\Users\user-name\Desktop\Tor Browser\Browser\firefox.exe " ? ?

2

This is a Bash script referenced in an answer to another thread. It assumes you're running on a Linux machine. (Notice how all the file paths use / instead of \.) It won't work on a Windows machine without modification.

(I would suggest continuing with your original thread, and updating your findings there.)

  • can i have this script for window's ? – Maulik Lathiya Nov 21 '15 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.