Changes between Version 38 and Version 39 of doc/TorBOX/ShellScript


Ignore:
Timestamp:
Feb 28, 2012, 1:53:19 AM (7 years ago)
Author:
cypherpunks
Comment:

outsource t-w script

Legend:

Unmodified
Added
Removed
Modified
  • doc/TorBOX/ShellScript

    v38 v39  
    1 [[TOC(noheading, depth=0)]]
    2 
    31https://trac.torproject.org/projects/tor/wiki/doc/TorBOX
    42
     
    201199echo "Tor-Gateway configuration successful." >&2
    202200}}}
    203 
    204 = Shell script for Tor-Workstations =
    205 
    206 
    207 {{{
    208 #!/bin/bash
    209 
    210 # ASSUMPTIONS:
    211 # You are using Debian/Ubuntu
    212 # eth0 is connected to Tor-Gateway, no networking has been set up so far.
    213 # You've taken care of time syncing, please refer to the How To for more information.
    214 # Please do not abuse the network by excessive software installation and updates.
    215 
    216 # Check if we are root
    217   if [ "$(id -u)" != "0" ]; then
    218      echo "This script must be run as root (sudo)"
    219      exit 1
    220   fi
    221 
    222 # remove problematic software
    223 apt-get --yes remove canonical-census  || true
    224 apt-get --yes remove --purge network-manager network-manager-gnome  || true
    225 apt-get --yes remove ntpdate || true
    226 
    227 # backup configs
    228 cp -n /etc/resolv.conf /etc/resolv.conf.backup
    229 cp -n /etc/network/interfaces /etc/network/interfaces.backup
    230 cp -n /etc/localtime /etc/localtime.backup
    231 
    232 cp /usr/share/zoneinfo/UTC /etc/localtime
    233 
    234 echo "nameserver 192.168.0.1" > /etc/resolv.conf
    235 echo "
    236 
    237 auto eth0
    238 iface eth0 inet static
    239 # increment last octet on additional workstations
    240 address 192.168.0.2
    241        netmask 255.255.255.0
    242        network 192.168.0.0
    243        broadcast 192.168.0.255
    244        gateway 192.168.0.1" >> /etc/network/interfaces
    245 
    246 /etc/init.d/networking restart
    247 
    248 # remove "<<COMMENT1" and "COMMENT1" if you want to install a hidden service
    249 <<COMMENT1
    250 apt-get update
    251 apt-get install thttpd
    252 
    253 cp -n /etc/default/thttpd /etc/default/thttpd.backup
    254 cp -n /etc/thttpd/thttpd.conf /etc/thttpd/thttpd.conf.backup
    255 
    256 echo "ENABLED=yes" > /etc/default/thttpd
    257 
    258 echo " # see /etc/thttpd/thttpd.conf.backup for comments and more options
    259 port=12345
    260 dir=/var/www
    261 chroot
    262 user=www-data
    263 logfile=/var/log/thttpd.log" > /etc/thttpd/thttpd.conf
    264 
    265 /etc/init.d/thttpd restart
    266 COMMENT1
    267 }}}