summaryrefslogtreecommitdiff
path: root/contrib/torify.in
blob: 474ae0f1fc29a35304aba2fbf1294496debe963d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /bin/sh
# Wrapper script for use of the tsocks(8) transparent socksification library
# See the tsocks(1) and torify(1) manpages.
# Modified by Jacob Appelbaum <jacob@appelbaum.net> April 16th 2006

# Define and ensure we have tsocks
TSOCKS=`which tsocks`;
if [ ! -x $TSOCKS ];
then
        echo "Can't find tsocks in PATH. Perhaps you haven't installed it?";
        exit 1;
fi

# Check for any argument list
if [ -z $1 ];
then
        echo "Usage: $0 <application> <arguments>";
        exit 1;
fi

# Define our tsocks config file
TSOCKS_CONF_FILE=@CONFDIR@/tor-tsocks.conf
export TSOCKS_CONF_FILE

# Check that we've got a tsocks config file
if [ -r $TSOCKS_CONF_FILE ];
then
	exec tsocks "$@"
else
	echo "Error: Missing tsocks configuration file \"$TSOCKS_CONF_FILE\".";
	exit 1;
fi