aboutsummaryrefslogtreecommitdiff
path: root/tools/ejabberdctl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ejabberdctl')
-rwxr-xr-xtools/ejabberdctl3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/ejabberdctl b/tools/ejabberdctl
index 9d3f7bd5a..c821e8081 100755
--- a/tools/ejabberdctl
+++ b/tools/ejabberdctl
@@ -4,7 +4,8 @@ NODE=ejabberd
HOST=localhost
# Define ejabberd environment
-base="`dirname $(which "$0")`/.."
+here=`which "$0" 2>/dev/null || echo .`
+base="`dirname $here`/.."
ROOTDIR=`(cd "$base"; echo $PWD)`
SASL_LOG_PATH=$ROOTDIR/sasl.log
EJABBERD_DB=$ROOTDIR/database/$NODE