summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-04-19 15:27:51 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-04-19 15:27:51 +0200
commit2c32d5136afae4922f665324a68d2910429544e3 (patch)
tree4ffc08708e3c1e0a5ce65013152d5750176364c1
parentdae73cf3d1cedc65569d93cc6240cdeab7b14af5 (diff)
downloadwatch-bz-2c32d5136afae4922f665324a68d2910429544e3.tar.gz
watch-bz-2c32d5136afae4922f665324a68d2910429544e3.tar.xz
watch-bz-2c32d5136afae4922f665324a68d2910429544e3.zip
make script aware about being possibly run from a symlink
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-xwatch-bz7
1 files changed, 6 insertions, 1 deletions
diff --git a/watch-bz b/watch-bz
index d766d94..bf0f5e0 100755
--- a/watch-bz
+++ b/watch-bz
@@ -15,7 +15,12 @@
set -u
export LANG=C
-HERE=$(dirname $0)
+if [ "$(readlink "$0")" = "$0" ]; then
+ HERE="$(dirname $0)"
+else
+ HERE="$(dirname $(readlink -f "$0"))"
+
+fi
BUGZILLA=$(which bugzilla 2>/dev/null)
BUGZILLA_ROOT=/usr