123456789101112131415161718192021222324252627282930313233343536373839 |
- #!/bin/bash -e
-
- NUMINST=$1
- DIR="/opt/tor/var"
-
- if [ -z "${NUMINST}" ]
- then
- echo "Usage: $0 <number of tor instances>"
- exit 1;
- fi
-
- NUMINST=`expr ${NUMINST} - 1`
-
- for i in `seq 0 ${NUMINST}`
- do
- mkdir -p ${DIR}/data.${i};
- chmod 700 ${DIR}/data.${i}
- cat <<EOF >${DIR}/torcc.${i}
- DataDirectory ${DIR}/data.${i}/
- PidFile ${DIR}/tor.${i}.pid
- RunAsDaemon 1
- User debian-tor
-
- ControlSocket ${DIR}/control.${i} GroupWritable RelaxDirModeCheck
- ControlSocketsGroupWritable 1
- SocksPort unix:${DIR}/socks.${i} WorldWritable
- SocksPort 900${i}
-
- CookieAuthentication 1
- CookieAuthFileGroupReadable 1
- CookieAuthFile ${DIR}/control.authcookie.${i}
-
- BandwidthRate 10MB
-
- Log notice syslog
- EOF
- done
-
- chown -R debian-tor:debian-tor ${DIR}
|