diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2015-05-20 14:06:03 +0200 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2015-05-20 14:06:03 +0200 |
commit | 3188941af20c020df756e82393649b561d46c984 (patch) | |
tree | 85f4a7cca7487255203eef604cb4e3d345a59c1b | |
parent | Add missing sm table (thanks to Rasim Kalimullin)(EJAB-1740) (diff) |
Add minor robustness on cluster scripts
-rwxr-xr-x | tools/joincluster | 6 | ||||
-rwxr-xr-x | tools/leavecluster | 6 |
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 |