torify.in 793 B

123456789101112131415161718192021222324252627282930313233
  1. #! /bin/sh -x
  2. # Wrapper script for use of the tsocks(8) transparent socksification library
  3. # See the tsocks(1) and torify(1) manpages.
  4. # Modified by Jacob Appelbaum <jacob@appelbaum.net> April 16th 2006
  5. # Define and ensure we have tsocks
  6. TSOCKS=`which tsocks`;
  7. if [ ! -x $TSOCKS ];
  8. then
  9. echo "Can't find tsocks in PATH. Perhaps you haven't installed it?";
  10. exit 1;
  11. fi
  12. # Check for any argument list
  13. if [ -z $1 ];
  14. then
  15. echo "Usage: $0 <application> <arguments>";
  16. exit 1;
  17. fi
  18. # Define our tsocks config file
  19. TSOCKS_CONF_FILE=@CONFDIR@/tor-tsocks.conf
  20. export TSOCKS_CONF_FILE
  21. # Check that we've got a tsocks config file
  22. if [ -r $TSOCKS_CONF_FILE ];
  23. then
  24. exec tsocks "$@"
  25. else
  26. echo "Error: Missing tsocks configuration file \"$TSOCKS_CONF_FILE\".";
  27. exit 1;
  28. fi