3 # Wrapper script for use of the tsocks(8) transparent socksification library
4 # See the tsocks(1) and torify(1) manpages.
6 # Copyright (c) 2004, 2006 Peter Palfrader
7 # Modified by Jacob Appelbaum <jacob@appelbaum.net> April 16th 2006
8 # May be distributed under the same terms as Tor itself
11 # Define and ensure we have tsocks
12 # XXX: what if we don't have which?
13 TSOCKS
="`which tsocks`"
16 echo "$0: Can't find tsocks in PATH. Perhaps you haven't installed it?" >&2
20 # Check for any argument list
23 echo "Usage: $0 <command> [<options>...]" >&2
26 if [ "$#" = 1 ] && ( [ "$1" = "-h" ] ||
[ "$1" = "--help" ] )
28 echo "Usage: $0 <command> [<options>...]"
32 # Define our tsocks config file
33 TSOCKS_CONF_FILE
="@CONFDIR@/tor-tsocks.conf"
34 export TSOCKS_CONF_FILE
36 # Check that we've got a tsocks config file
37 if [ -r "$TSOCKS_CONF_FILE" ]
40 echo "$0: Failed to exec tsocks $@" >&2
43 echo "$0: Missing tsocks configuration file \"$TSOCKS_CONF_FILE\"." >&2