From ec8ea09c7d3fe2b36dc9855b53d27aaf2ae5fd94 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 15 Aug 2014 13:09:26 +0200 Subject: [PATCH] remove the loop in script, use readlink -f instead --- sshuttle | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sshuttle b/sshuttle index 2d234d5..2045376 100755 --- a/sshuttle +++ b/sshuttle @@ -1,10 +1,7 @@ #!/bin/sh -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") + +DIR="$(dirname $(readlink -f ${0}))" + if python2 -V 2>/dev/null; then exec python2 "$DIR/main.py" python2 "$@" else