|
@ -44,13 +44,14 @@ out=$(ddb < <(echo "use $DBNAME"; |
|
|
echo "$cmd")) |
|
|
echo "$cmd")) |
|
|
|
|
|
|
|
|
if [[ "$out" == *"\"codeName\" : \"AlreadyInitialized\""* ]]; then |
|
|
if [[ "$out" == *"\"codeName\" : \"AlreadyInitialized\""* ]]; then |
|
|
exit 0 |
|
|
|
|
|
|
|
|
info "ReplicaSet already initialized." |
|
|
|
|
|
elif [[ "$out" == *"\"ok\" : 1"* ]]; then |
|
|
|
|
|
info "ReplicaSet initialized. " |
|
|
|
|
|
else |
|
|
|
|
|
err "ReplicaSet initialisation failed:" |
|
|
|
|
|
echo "$out" >&2 |
|
|
|
|
|
exit 13 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
if [[ "$out" == *"\"ok\" : 1"* ]]; then |
|
|
|
|
|
exit 0 |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
err Replicate Set initialisation failed |
|
|
|
|
|
echo "$out" >&2 |
|
|
|
|
|
|
|
|
|