aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-cassandra/scripts/ready_probe.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-os-chef/sdc-cassandra/scripts/ready_probe.sh')
-rw-r--r--sdc-os-chef/sdc-cassandra/scripts/ready_probe.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/sdc-os-chef/sdc-cassandra/scripts/ready_probe.sh b/sdc-os-chef/sdc-cassandra/scripts/ready_probe.sh
new file mode 100644
index 0000000000..f51ccdb570
--- /dev/null
+++ b/sdc-os-chef/sdc-cassandra/scripts/ready_probe.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Source the environment file
+. /root/scripts/cassandra-env.sh
+
+if [ "$(nodetool status | tail -n2 | grep -Ev '^$')" != "" ]; then
+ if echo "exit" | cqlsh -u cassandra -p "$CASSANDRA_PASS" "$CASSANDRA_IP" "$CASSANDRA_PORT" > /dev/null 2>&1; then
+ exit 0
+ else
+ exit 1
+ fi
+else
+ echo "Not Up"
+ exit 1
+fi