- echo "Docker Installed Basic Cassandra on aaf_cass. Executing the following "
- echo "NOTE: This creator provided is only a Single Instance. For more complex Cassandra, create independently"
- echo ""
- echo " cd /opt/app/cass_init"
- echo " cqlsh -f keyspace.cql"
- echo " cqlsh -f init.cql"
- echo " cqlsh -f osaaf.cql"
- echo ""
- echo "The following will give you a temporary identity with which to start working, or emergency"
- echo " cqlsh -f temp_identity.cql"
- echo "Create Keyspaces and Tables"
- $DOCKER exec aaf_cass bash /usr/bin/cqlsh -f /opt/app/cass_init/keyspace.cql
- $DOCKER exec aaf_cass bash /usr/bin/cqlsh -e 'describe keyspaces'
- $DOCKER exec aaf_cass bash /usr/bin/cqlsh -f /opt/app/cass_init/init.cql
- $DOCKER exec aaf_cass bash /usr/bin/cqlsh -f /opt/app/cass_init/osaaf.cql
- $DOCKER exec aaf_cass bash /usr/bin/cqlsh -f /opt/app/cass_init/temp_indentity.cql
+ if [ "`$DOCKER exec aaf_cass /usr/bin/cqlsh -e 'describe keyspaces' | grep authz`" == "" ]; then
+ echo "Docker Installed Basic Cassandra on aaf_cass. Executing the following "
+ echo "NOTE: This creator provided is only a Single Instance. For more complex Cassandra, create independently"
+ echo ""
+ echo " cd /opt/app/cass_init"
+ echo " cqlsh -f keyspace.cql"
+ echo " cqlsh -f init.cql"
+ echo " cqlsh -f osaaf.cql"
+ echo ""
+ echo "The following will give you a temporary identity with which to start working, or emergency"
+ echo " cqlsh -f temp_identity.cql"
+ echo "Create Keyspaces and Tables"
+ $DOCKER exec aaf_cass bash /usr/bin/cqlsh -f /opt/app/cass_init/keyspace.cql
+ $DOCKER exec aaf_cass bash /usr/bin/cqlsh -e 'describe keyspaces'
+ $DOCKER exec aaf_cass bash /usr/bin/cqlsh -f /opt/app/cass_init/init.cql
+ $DOCKER exec aaf_cass bash /usr/bin/cqlsh -f /opt/app/cass_init/osaaf.cql
+ $DOCKER exec aaf_cass bash /usr/bin/cqlsh -f /opt/app/cass_init/temp_identity.cql
+ fi