summaryrefslogtreecommitdiff
path: root/scripts/wsrep_sst_common.sh
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@skysql.com>2014-06-10 17:00:32 -0400
committerNirbhay Choubey <nirbhay@skysql.com>2014-06-10 17:00:32 -0400
commitc29cbac2eb06ab4a2bf1aeda65c15fce40a84345 (patch)
tree9d5b5dab4dfd0fe78084b0654cd06d6f3fc1171b /scripts/wsrep_sst_common.sh
parent90ead99572c8168583cb0943792d964cc2a6abd2 (diff)
downloadmariadb-git-c29cbac2eb06ab4a2bf1aeda65c15fce40a84345.tar.gz
bzr merge -r3985..3997 codership/5.5
Diffstat (limited to 'scripts/wsrep_sst_common.sh')
-rw-r--r--scripts/wsrep_sst_common.sh26
1 files changed, 25 insertions, 1 deletions
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index b6c10ba4e7d..d9aa24169ce 100644
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -1,4 +1,4 @@
-# Copyright (C) 2012 Codership Oy
+# Copyright (C) 2012-2014 Codership Oy
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -125,3 +125,27 @@ wsrep_cleanup_progress_file()
{
[ -n "$SST_PROGRESS_FILE" ] && rm -f "$SST_PROGRESS_FILE" 2>/dev/null
}
+
+wsrep_check_program()
+{
+ local prog=$1
+
+ if ! which $prog >/dev/null
+ then
+ echo "'$prog' not found in PATH"
+ return 2 # no such file or directory
+ fi
+}
+
+wsrep_check_programs()
+{
+ local ret=0
+
+ while [ $# -gt 0 ]
+ do
+ wsrep_check_program $1 || ret=$?
+ shift
+ done
+
+ return $ret
+}