6bb07f80ebe4f861a1d8591a1fbd2f765c51714a
[oom.git] / kubernetes / config / docker / init / src / config / consul / consul-agent-config / scripts / sdnc-dbhost-script.sh
1 SDNC_DBHOST_POD=$(/consul/config/bin/kubectl -n onap-sdnc  get pod | grep -o "sdnc-dbhost-[^[:space:]]*")
2 if [ -n "$SDNC_DBHOST_POD" ]; then
3    if /consul/config/bin/kubectl -n onap-sdnc exec -it $SDNC_DBHOST_POD -- ./healthcheck.sh |grep -i "mysqld is alive"; then
4       echo Success. SDNC DBHost is running. 2>&1
5       exit 0
6    else
7       echo Failed. SDNC DBHost is not running. 2>&1
8       exit 1
9    fi
10 else
11    echo Failed. SDNC DBHost is offline. 2>&1
12    exit 1
13 fi