aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-cassandra/scripts/ready_probe.sh
blob: f51ccdb570251a6a59390746fbddd36df864d013 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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