mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Check if kubectl is installed otherwise exit
This commit is contained in:
parent
6d27cbe868
commit
d85396b220
@ -1,10 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Checking if kubectl exists
|
||||||
|
command -v kubectl > /dev/null
|
||||||
|
if [ $? -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "kubectl already installed!"
|
||||||
|
else
|
||||||
|
echo "Please install kubectl!! https://kubernetes.io/docs/tasks/tools/install-kubectl/"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
[ -z $1 ] && echo "Please specify MongoDB instance name!!"
|
[ -z $1 ] && echo "Please specify MongoDB instance name!!"
|
||||||
MONGODB_INSTANCE_NAME=$1
|
MONGODB_INSTANCE_NAME=$1
|
||||||
|
|
||||||
if [[ -n "$MONGODB_INSTANCE_NAME" ]]; then
|
if [[ -n "$MONGODB_INSTANCE_NAME" ]]; then
|
||||||
/usr/local/bin/kubectl exec -it "${MONGODB_INSTANCE_NAME}"\-ss\-0 -- bash -c "if [[ -f /tmp/configure_mongo && -n \$(cat /tmp/configure_mongo) ]]; then /usr/bin/mongo --host localhost --port \$(printenv MONGODB_PORT) --ssl --sslCAFile /etc/mongod/ca/ca.pem --sslPEMKeyFile /etc/mongod/ssl/mdb-instance.pem < /configure_mdb_users.js; fi"
|
/usr/local/bin/kubectl exec -it "${MONGODB_INSTANCE_NAME}"\-ss\-0 -- bash -c "if [[ -f /tmp/configure_mongo && -n \$(cat /tmp/configure_mongo) ]]; then /usr/bin/mongo --host localhost --port \$(printenv MONGODB_PORT) --ssl --sslCAFile /etc/mongod/ca/ca.pem --sslPEMKeyFile /etc/mongod/ssl/mdb-instance.pem < /configure_mdb_users.js; fi"
|
||||||
else
|
else
|
||||||
echo "Skipping configuration!!!"
|
echo "Skipping configuration, because relevant files don't exist!!!"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user