blob: 74064816a27a8d49dbe387cdd6e8f2dfe8b88842 [file] [log] [blame]
Priyanka Jainc07e1d12018-05-03 12:52:04 +00001SDNC_DBHOST_POD=$(/consul/bin/kubectl -n {{ include "common.namespace" . }} get pod | grep -o "sdnc-dbhost-[^[:space:]]*")
jasmineWen85d9d732018-03-06 16:13:35 +00002if [ -n "$SDNC_DBHOST_POD" ]; then
Priyanka Jainc07e1d12018-05-03 12:52:04 +00003 if /consul/bin/kubectl -n {{ include "common.namespace" . }} exec -it $SDNC_DBHOST_POD -- ./healthcheck.sh |grep -i "mysqld is alive"; then
jasmineWen85d9d732018-03-06 16:13:35 +00004 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
10else
11 echo Failed. SDNC DBHost is offline. 2>&1
12 exit 1
13fi