3 # Engage normal Cass Init, then check for data installation
5 if [ ! -e /aaf_cmd ]; then
6 ln -s /opt/app/aaf/cass_init/cmd.sh /aaf_cmd
10 function install_cql {
11 # Now, make sure data exists
12 if [ "$(/usr/bin/cqlsh -e 'describe keyspaces' | grep authz)" = "" ]; then
13 for CNT in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
14 if [ -z "$(grep 'listening for CQL clients' /var/log/cassandra/system.log)" ]; then
15 echo "Waiting for Cassandra to start... Sleep 10"
21 echo "Initializing Cassandra DB"
22 if [ "`/usr/bin/cqlsh -e 'describe keyspaces' | grep authz`" == "" ]; then
23 echo "Docker Installed Basic Cassandra on aaf_cass. Executing the following "
24 echo "NOTE: This creator provided is only a Single Instance. For more complex Cassandra, create independently"
26 echo " cd /opt/app/aaf/cass_init"
27 cd /opt/app/aaf/cass_init
28 echo " cqlsh -f keyspace.cql"
29 /usr/bin/cqlsh -f keyspace.cql
30 echo " cqlsh -f init.cql"
31 /usr/bin/cqlsh -f init.cql
33 echo "The following will give you a temporary identity with which to start working, or emergency"
34 echo " cqlsh -f temp_identity.cql"
42 echo "Cassandra Startup"
43 /usr/local/bin/docker-entrypoint.sh
48 # Change date expiring dat files to more recent
49 ID_FILE=/opt/app/aaf/cass_init/sample.identities.dat
50 if [ -e $ID_FILE ]; then
51 DATE=$(date "+%Y-%m-%d %H:%M:%S.000+0000" -d "+6 months")
53 CRED="/opt/app/aaf/cass_init/dats/cred.dat"
55 echo "Default Passwords for Apps"
56 for ID in $(grep '|a|' $ID_FILE | sed -e "s/|.*//"); do
57 if [ "$ID" = "aaf" ]; then
58 DOMAIN="aaf.osaaf.org";
60 DOMAIN="$ID.onap.org";
63 for D in ${DOMAIN//./ }; do
64 if [ -z "$FIRST" ]; then
71 echo "$ID@$DOMAIN|2|${DATE}|0xd993c5617486296f1b99d04de31633332b8ba1a550038e23860f9dbf0b2fcf95|Initial ID|$NS|53344|" >> $CRED
75 for ID in $(grep '|e|' $ID_FILE | sed -e "s/|.*//"); do
76 echo "$ID@people.osaaf.org|2|${DATE}|0xd993c5617486296f1b99d04de31633332b8ba1a550038e23860f9dbf0b2fcf95|Initial ID|org.osaaf.people|53344|" >> $CRED
80 mv dats/user_role.dat tmp
81 sed "s/\(^.*|\)\(.*|\)\(.*|\)\(.*\)/\1${DATE}|\3\4/" tmp > dats/user_role.dat
83 # Remove ID File, which is marker for initializing Creds