From 23aa8598ab8a586f2c6300b8f6d1b0b672e2e7f4 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Thu, 23 Apr 2015 10:14:08 +0200 Subject: [PATCH] Allow bypassing script interraction (#516) --- tools/joincluster | 28 +++++++++++++++------------- tools/leavecluster | 28 ++++++++++++++++------------ 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/tools/joincluster b/tools/joincluster index de36e437c..e62084bc4 100755 --- a/tools/joincluster +++ b/tools/joincluster @@ -21,19 +21,21 @@ function error exit $2 } -echo "--------------------------------------------------------------------" -echo "" -echo "ejabberd cluster configuration" -echo "" -echo "This ejabberd node will be configured for use in an ejabberd cluster." -echo "IMPORTANT: all local data from the database will be lost, and" -echo "cluster database will be initialized. All data from the master" -echo "node will be replicated to this one." -echo "" -echo "--------------------------------------------------------------------" -echo "Press any key to continue, or Ctrl+C to stop now" -read foo -echo "" +[ -z $NO_WARNINGS ] && { + echo "--------------------------------------------------------------------" + echo "" + echo "ejabberd cluster configuration" + echo "" + echo "This ejabberd node will be configured for use in an ejabberd cluster." + echo "IMPORTANT: all local data from the database will be lost, and" + echo "cluster database will be initialized. All data from the master" + echo "node will be replicated to this one." + echo "" + echo "--------------------------------------------------------------------" + echo "Press any key to continue, or Ctrl+C to stop now" + read foo + echo "" +} [ $# -eq 0 ] && { echo "Make sure you have a running remote master ejabberd node" diff --git a/tools/leavecluster b/tools/leavecluster index cb4737adb..7acc2b46c 100755 --- a/tools/leavecluster +++ b/tools/leavecluster @@ -17,18 +17,22 @@ function error exit $2 } -echo "--------------------------------------------------------------------" -echo "" -echo "ejabberd cluster configuration" -echo "" -echo "This ejabberd node will be removed from the cluster." -echo "IMPORTANT: this node will be stopped. At least one other clustered" -echo "node must be running." -echo "" -echo "--------------------------------------------------------------------" -echo "Press any key to continue, or Ctrl+C to stop now" -read foo -echo "" +[ -z $NO_WARNINGS ] && { + echo "--------------------------------------------------------------------" + echo "" + echo "ejabberd cluster configuration" + echo "" + echo "This ejabberd node will be removed from the cluster." + echo "IMPORTANT: this node will be stopped. At least one other clustered" + echo "node must be running." + echo "" + echo "--------------------------------------------------------------------" + echo "Press any key to continue, or Ctrl+C to stop now" + read foo + echo "" +} +echo ok +exit PA=/tmp/clustersetup_$$ CTL=$(which ejabberdctl)