Permalink
Browse files

Handle symlinks in the wrapper scripts

  • Loading branch information...
nox committed Feb 4, 2011
1 parent ccd717e commit 989c739f1d69a1ec2760f9b0966dde1ff8ad0d0b
Showing with 23 additions and 2 deletions.
  1. +4 −0 priv/bin/dtop
  2. +4 −0 priv/bin/gperf
  3. +5 −1 priv/bin/ntop
  4. +6 −1 priv/bin/redbug
  5. +4 −0 priv/bin/sherk
View
@@ -16,6 +16,10 @@ else
SPATH=`which $0`
fi
+if [ -L $SPATH ];then
+ SPATH=`readlink $SPATH`
+fi
+
n=3
while [ 0 -lt "$n" ]; do SPATH=`dirname $SPATH`; let n=n-1; done
ERL=erl
View
@@ -16,6 +16,10 @@ else
SPATH=`which $0`
fi
+if [ -L $SPATH ];then
+ SPATH=`readlink $SPATH`
+fi
+
n=4
while [ 0 -lt "$n" ]; do SPATH=`dirname $SPATH`; let n=n-1; done
PATHS=""
View
@@ -16,7 +16,11 @@ else
SPATH=`which $0`
fi
-script=`basename $0`
+if [ -L $SPATH ];then
+ SPATH=`readlink $SPATH`
+fi
+
+script=`basename $SPATH`
n=3
while [ 0 -lt "$n" ]; do SPATH=`dirname $SPATH`; let n=n-1; done
View
@@ -1,6 +1,11 @@
#!/bin/bash
-self=`dirname $_`
+SPATH=$_
+if [ -L $SPATH ];then
+ SPATH=`readlink $SPATH`
+fi
+
+self=`dirname $SPATH`
self=`dirname $self`
self=`dirname $self`
self=`(cd $self ; pwd)`
View
@@ -15,6 +15,10 @@ else
SPATH=`which $0`
fi
+if [ -L $SPATH ];then
+ SPATH=`readlink $SPATH`
+fi
+
n=4
while [ 0 -lt "$n" ]; do SPATH=`dirname $SPATH`; let n=n-1; done
PATHS=""

0 comments on commit 989c739

Please sign in to comment.