summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaizoku <kaizoku@phear.cc>2011-04-09 23:51:15 -0700
committerAvery Pennarun <apenwarr@gmail.com>2011-04-24 22:42:50 -0400
commit86363788707260e3d310bcec2ce941e797db9426 (patch)
tree8574ef8d6bd1f0544b523e687c151fe69e185655
parentf5eed4c809cc898188896841ce1edae70918c739 (diff)
Dereference symlink for sshuttle launch script
(Modified slightly by apenwarr)
-rwxr-xr-xsshuttle7
1 files changed, 6 insertions, 1 deletions
diff --git a/sshuttle b/sshuttle
index d832198..2d234d5 100755
--- a/sshuttle
+++ b/sshuttle
@@ -1,5 +1,10 @@
#!/bin/sh
-DIR=$(dirname "$0")
+EXE=$0
+for i in 1 2 3 4 5 6 7 8 9 10; do
+ [ -L "$EXE" ] || break
+ EXE=$(readlink "$EXE")
+done
+DIR=$(dirname "$EXE")
if python2 -V 2>/dev/null; then
exec python2 "$DIR/main.py" python2 "$@"
else