aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/joincluster6
-rwxr-xr-xtools/leavecluster6
2 files changed, 6 insertions, 6 deletions
diff --git a/tools/joincluster b/tools/joincluster
index b3516d94d..ff2e0380f 100755
--- a/tools/joincluster
+++ b/tools/joincluster
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# Add the current ejabberd node in a cluster
@@ -56,7 +56,7 @@ function error
PA=/tmp/clustersetup_$$
CTL=$(which ejabberdctl)
-[ "$CTL" == "" ] && {
+[ -x "$CTL" ] || {
HERE=`which "$0"`
BASE=`dirname $HERE`/..
ROOTDIR=`cd $BASE; pwd`
@@ -65,7 +65,7 @@ CTL=$(which ejabberdctl)
CTL=$(which ejabberdctl)
}
echo "Using commands:"
-[ -x $CTL ] && echo $CTL || error "can't find ejabberdctl" 10
+[ -x "$CTL" ] && echo $CTL || error "can't find ejabberdctl" 10
. $CTL stop 2>/dev/null >/dev/null
ERLC=${ERL}c
diff --git a/tools/leavecluster b/tools/leavecluster
index 7acc2b46c..edac8689e 100755
--- a/tools/leavecluster
+++ b/tools/leavecluster
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
# Remove the current ejabberd node in a cluster
@@ -36,7 +36,7 @@ exit
PA=/tmp/clustersetup_$$
CTL=$(which ejabberdctl)
-[ "$CTL" == "" ] && {
+[ -x "$CTL" ] || {
HERE=`which "$0"`
BASE=`dirname $HERE`/..
ROOTDIR=`cd $BASE; pwd`
@@ -45,7 +45,7 @@ CTL=$(which ejabberdctl)
CTL=$(which ejabberdctl)
}
echo "Using commands:"
-[ -x $CTL ] && echo $CTL || error "can't find ejabberdctl" 10
+[ -x "$CTL" ] && echo $CTL || error "can't find ejabberdctl" 10
. $CTL stop 2>/dev/null >/dev/null
ERLC=${ERL}c