mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Add minor robustness on cluster scripts
This commit is contained in:
parent
fcdb519770
commit
3188941af2
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user