On Tue, Jul 17, 2001 at 11:31:14AM +0200, Bernhard Josef Rieder wrote: > > #!/bin/sh > > case "$1" in > on) > if [ -z "$LD_PRELOAD" ] > then > export LD_PRELOAD="/usr/lib/libtsocks.so" > else > echo $LD_PRELOAD | grep -q "/usr/lib/libtsocks\.so" || > export LD_PRELOAD="/usr/lib/libtsocks.so:$LD_PRELOAD" > fi > ;; > off) > export LD_PRELOAD=`echo -n $LD_PRELOAD | sed "s/\/usr\/lib\/libtsocks.so:\?//"` > if [ -z "$LD_PRELOAD" ] > then > unset LD_PRELOAD > fi > ;; > esac > > 8= 8= 8= 8= 8= 8= > > It makes using tsocks really simple. If you want to use tsocks type > tsocks on and the other LD_PRELOAD settings stay untouched > > If you want to stop using it then type tsocks off. That's it. um this won't work. the shell script will run as its own process which means its unable to affect the environment of the parent (your shell). running this script will always be a noop. you could exec a new shell at the end, but thats gross since every time you run it you get ya shell stacked on top. (which means you will have to type logout as many times as you ran this script to actually logout). -- Ethan Benson http://www.alaska.net/~erbenson/
Attachment:
pgpOJSLMSWVzi.pgp
Description: PGP signature