25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Add minor robustness on cluster scripts

This commit is contained in:
Christophe Romain 2015-05-20 14:06:03 +02:00
parent fcdb519770
commit 3188941af2
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env bash
# Add the current ejabberd node in a cluster # Add the current ejabberd node in a cluster
@ -56,7 +56,7 @@ function error
PA=/tmp/clustersetup_$$ PA=/tmp/clustersetup_$$
CTL=$(which ejabberdctl) CTL=$(which ejabberdctl)
[ "$CTL" == "" ] && { [ -x "$CTL" ] || {
HERE=`which "$0"` HERE=`which "$0"`
BASE=`dirname $HERE`/.. BASE=`dirname $HERE`/..
ROOTDIR=`cd $BASE; pwd` ROOTDIR=`cd $BASE; pwd`
@ -65,7 +65,7 @@ CTL=$(which ejabberdctl)
CTL=$(which ejabberdctl) CTL=$(which ejabberdctl)
} }
echo "Using commands:" 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 . $CTL stop 2>/dev/null >/dev/null
ERLC=${ERL}c ERLC=${ERL}c

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/usr/bin/env bash
# Remove the current ejabberd node in a cluster # Remove the current ejabberd node in a cluster
@ -36,7 +36,7 @@ exit
PA=/tmp/clustersetup_$$ PA=/tmp/clustersetup_$$
CTL=$(which ejabberdctl) CTL=$(which ejabberdctl)
[ "$CTL" == "" ] && { [ -x "$CTL" ] || {
HERE=`which "$0"` HERE=`which "$0"`
BASE=`dirname $HERE`/.. BASE=`dirname $HERE`/..
ROOTDIR=`cd $BASE; pwd` ROOTDIR=`cd $BASE; pwd`
@ -45,7 +45,7 @@ CTL=$(which ejabberdctl)
CTL=$(which ejabberdctl) CTL=$(which ejabberdctl)
} }
echo "Using commands:" 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 . $CTL stop 2>/dev/null >/dev/null
ERLC=${ERL}c ERLC=${ERL}c