Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 1 | #!/bin/bash |
Instrumental | 7a1817b | 2018-11-05 11:11:15 -0600 | [diff] [blame] | 2 | ######### |
| 3 | # ============LICENSE_START==================================================== |
| 4 | # org.onap.aaf |
| 5 | # =========================================================================== |
| 6 | # Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. |
| 7 | # =========================================================================== |
| 8 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | # you may not use this file except in compliance with the License. |
| 10 | # You may obtain a copy of the License at |
| 11 | # |
| 12 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | # |
| 14 | # Unless required by applicable law or agreed to in writing, software |
| 15 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | # See the License for the specific language governing permissions and |
| 18 | # limitations under the License. |
| 19 | # ============LICENSE_END==================================================== |
| 20 | # |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 21 | # This script is run when starting aaf_config Container. |
| 22 | # It needs to cover the cases where the initial data doesn't exist, and when it has already been configured (don't overwrite) |
| 23 | # |
| 24 | JAVA=/usr/bin/java |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 25 | |
| 26 | OSAAF=/opt/app/osaaf |
| 27 | LOCAL=$OSAAF/local |
| 28 | DATA=$OSAAF/data |
| 29 | PUBLIC=$OSAAF/public |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 30 | CONFIG=/opt/app/aaf_config |
Instrumental | 5451a50 | 2018-10-10 18:51:33 -0500 | [diff] [blame] | 31 | |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 32 | JAVA_CADI="$JAVA -cp $CONFIG/bin/aaf-auth-cmd-*-full.jar org.onap.aaf.cadi.CmdLine" |
| 33 | JAVA_AGENT="$JAVA -cp $CONFIG/bin/aaf-auth-cmd-*-full.jar -Dcadi_prop_files=$LOCAL/org.osaaf.aaf.props org.onap.aaf.cadi.configure.Agent" |
| 34 | JAVA_AAFCLI="$JAVA -cp $CONFIG/bin/aaf-auth-cmd-*-full.jar -Dcadi_prop_files=$LOCAL/org.osaaf.aaf.props org.onap.aaf.auth.cmd.AAFcli" |
| 35 | |
Instrumental | 5451a50 | 2018-10-10 18:51:33 -0500 | [diff] [blame] | 36 | # If doesn't exist... still create |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 37 | mkdir -p $OSAAF |
Instrumental | 5451a50 | 2018-10-10 18:51:33 -0500 | [diff] [blame] | 38 | |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 39 | # Temp use for clarity of code |
| 40 | FILE= |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 41 | |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 42 | # Setup Bash, first time only |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 43 | if [ ! -e "$HOME/.bash_aliases" ] || [ -z "$(grep cadi $HOME/.bash_aliases)" ]; then |
| 44 | echo "alias cadi='$JAVA_CADI \$*'" >>$HOME/.bash_aliases |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 45 | echo "alias agent='$CONFIG/bin/agent.sh \$*'" >>$HOME/.bash_aliases |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 46 | echo "alias aafcli='$JAVA_AAFCLI \$*'" >>$HOME/.bash_aliases |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 47 | chmod a+x $CONFIG/bin/agent.sh |
| 48 | . $HOME/.bash_aliases |
| 49 | fi |
| 50 | |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 51 | # Only load Identities once |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 52 | # echo "Check Identities" |
| 53 | FILE="$DATA/identities.dat" |
| 54 | if [ ! -e $FILE ]; then |
| 55 | mkdir -p $DATA |
| 56 | cp $CONFIG/data/sample.identities.dat $FILE |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 57 | echo "Set Identities" |
| 58 | INITIALIZED="true" |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 59 | fi |
| 60 | |
| 61 | # Load up Cert/X509 Artifacts |
| 62 | # echo "Check Signer Keyfile" |
| 63 | FILE="$LOCAL/org.osaaf.aaf.signer.p12" |
| 64 | if [ ! -e $FILE ]; then |
| 65 | mkdir -p $LOCAL |
| 66 | mkdir -p $PUBLIC |
| 67 | if [ -e $CONFIG/cert/org.osaaf.aaf.signer.p12 ]; then |
| 68 | cp $CONFIG/cert/org.osaaf.aaf.signer.p12 $FILE |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 69 | echo "Installed Signer P12" |
| 70 | INITIALIZED="true" |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 71 | else |
| 72 | echo "Decode" |
| 73 | base64 -d $CONFIG/cert/demoONAPsigner.p12.b64 > $FILE |
| 74 | base64 -d $CONFIG/cert/truststoreONAP.p12.b64 > $PUBLIC/truststoreONAP.p12 |
| 75 | base64 -d $CONFIG/cert/truststoreONAPall.jks.b64 > $PUBLIC/truststoreONAPall.jks |
| 76 | ln -s $PUBLIC/truststoreONAPall.jks $LOCAL |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 77 | cp $CONFIG/cert/AAF_RootCA.cer $PUBLIC |
| 78 | CM_TRUST_CAS="$PUBLIC/AAF_RootCA.cer" |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 79 | echo "cadi_keystore_password=something easy" >> $CONFIG/local/aaf.props |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 80 | echo "Setup ONAP Test CAs and Signers" |
| 81 | INITIALIZED="true" |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 82 | fi |
| 83 | fi |
| 84 | |
| 85 | # echo "Check keyfile" |
| 86 | FILE="$LOCAL/org.osaaf.aaf.p12" |
| 87 | if [ ! -e $FILE ]; then |
| 88 | if [ -e $CONFIG/cert/org.osaaf.aaf.p12 ]; then |
| 89 | cp $CONFIG/cert/org.osaaf.aaf.p12 $FILE |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 90 | echo "Installed AAF P12" |
| 91 | INITIALIZED="true" |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 92 | else |
| 93 | echo "Bootstrap Creation of Keystore from Signer" |
| 94 | cd $CONFIG/CA |
| 95 | |
| 96 | # Remove this after Casablanca |
| 97 | CADI_X509_ISSUERS="CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US" |
| 98 | bash bootstrap.sh $LOCAL/org.osaaf.aaf.signer.p12 'something easy' |
| 99 | cp aaf.bootstrap.p12 $FILE |
| 100 | if [ -n "$CADI_X509_ISSUERS" ]; then |
| 101 | CADI_X509_ISSUERS="$CADI_X509_ISSUERS:" |
| 102 | fi |
| 103 | BOOT_ISSUER="$(cat aaf.bootstrap.issuer)" |
| 104 | CADI_X509_ISSUERS="$CADI_X509_ISSUERS$BOOT_ISSUER" |
| 105 | |
| 106 | I=${BOOT_ISSUER##CN=};I=${I%%,*} |
| 107 | CM_CA_PASS="something easy" |
| 108 | CM_CA_LOCAL="org.onap.aaf.auth.cm.ca.LocalCA,$LOCAL/org.osaaf.aaf.signer.p12;aaf_intermediate_9;enc:" |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 109 | CM_TRUST_CAS="$PUBLIC/AAF_RootCA.cer" |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 110 | echo "Generated ONAP Test AAF certs" |
| 111 | INITIALIZED="true" |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 112 | fi |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 113 | fi |
| 114 | |
| 115 | # Only initialize once, automatically... |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 116 | if [ ! -e $LOCAL/org.osaaf.aaf.props ]; then |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 117 | cp $CONFIG/local/org.osaaf.aaf* $LOCAL |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 118 | for D in public etc logs; do |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 119 | mkdir -p $OSAAF/$D |
| 120 | cp $CONFIG/$D/* $OSAAF/$D |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 121 | done |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 122 | |
| 123 | TMP=$(mktemp) |
| 124 | echo aaf_env=${AAF_ENV} >> ${TMP} |
Instrumental | 575c982 | 2018-10-19 11:13:05 -0500 | [diff] [blame] | 125 | echo aaf_release=${VERSION} >> ${TMP} |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 126 | echo cadi_latitude=${LATITUDE} >> ${TMP} |
| 127 | echo cadi_longitude=${LONGITUDE} >> ${TMP} |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 128 | echo cadi_x509_issuers=${CADI_X509_ISSUERS} >> ${TMP} |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 129 | AAF_LOCATE_URL=${aaf_locate_url:="https://${HOSTNAME}:8095"} |
| 130 | echo aaf_locate_url=${AAF_LOCATE_URL} >> ${TMP} |
| 131 | for P in `env`; do |
| 132 | if [[ "$P" == aaf_locator* ]]; then |
| 133 | echo "$P" >> ${TMP} |
| 134 | if [[ "$P" == aaf_locator_container=* ]]; then |
| 135 | echo aaf_locator_container.hostname=${HOSTNAME} >> ${TMP} |
| 136 | fi |
| 137 | fi |
| 138 | done |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 139 | |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 140 | cat $TMP |
| 141 | |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 142 | $JAVA_AGENT config \ |
| 143 | aaf@aaf.osaaf.org \ |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 144 | cadi_etc_dir=$LOCAL \ |
| 145 | cadi_prop_files=$CONFIG/local/initialConfig.props:$CONFIG/local/aaf.props:${TMP} |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 146 | rm ${TMP} |
Instrumental | 196000b | 2018-10-05 19:30:59 -0500 | [diff] [blame] | 147 | |
| 148 | # Cassandra Config stuff |
| 149 | # Default is expect a Cassandra on same Node |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 150 | CASS_HOST=${CASS_HOST:="aaf-cass"} |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 151 | CASS_PASS=$($JAVA_CADI digest "${CASSANDRA_PASSWORD:-cassandra}" $LOCAL/org.osaaf.aaf.keyfile) |
Instrumental | 196000b | 2018-10-05 19:30:59 -0500 | [diff] [blame] | 152 | CASS_NAME=${CASS_HOST/:*/} |
Instrumental | 14f3707 | 2018-10-09 08:32:06 -0500 | [diff] [blame] | 153 | sed -i.backup -e "s/\\(cassandra.clusters=\\).*/\\1${CASSANDRA_CLUSTERS:=$CASS_HOST}/" \ |
Instrumental | 196000b | 2018-10-05 19:30:59 -0500 | [diff] [blame] | 154 | -e "s/\\(cassandra.clusters.user=\\).*/\\1${CASSANDRA_USER:=cassandra}/" \ |
| 155 | -e "s/\\(cassandra.clusters.password=enc:\\).*/\\1$CASS_PASS/" \ |
| 156 | -e "s/\\(cassandra.clusters.port=\\).*/\\1${CASSANDRA_PORT:=9042}/" \ |
| 157 | $LOCAL/org.osaaf.aaf.cassandra.props |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 158 | |
| 159 | if [ -n "$CM_CA_LOCAL" ]; then |
| 160 | if [ -n "$CM_CA_PASS" ]; then |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 161 | CM_CA_LOCAL=$CM_CA_LOCAL$($JAVA_CADI digest "$CM_CA_PASS" $LOCAL/org.osaaf.aaf.keyfile) |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 162 | fi |
| 163 | # Move and copy method, rather than sed, because of slashes in CM_CA_LOCAL makes too complex |
| 164 | FILE=$LOCAL/org.osaaf.aaf.cm.ca.props |
| 165 | mv $FILE $FILE.backup |
| 166 | grep -v "cm_ca.local=" $FILE.backup > $FILE |
| 167 | echo "cm_ca.local=$CM_CA_LOCAL" >> $FILE |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 168 | echo "cm_trust_cas=$CM_TRUST_CAS" >> $FILE |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 169 | fi |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 170 | echo "Created AAF Initial Configurations" |
| 171 | INITIALIZED="true" |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 172 | fi |
Instrumental | 9ec2895 | 2018-07-12 11:14:10 -0500 | [diff] [blame] | 173 | |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 174 | |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 175 | # Now run a command |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 176 | CMD=$1 |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 177 | if [ -z "$CMD" ]; then |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 178 | if [ -n "$INITIALIZED" ]; then |
| 179 | echo "Initialization Complete" |
| 180 | else |
| 181 | echo "No Additional Initialization required" |
| 182 | fi |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 183 | else |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 184 | shift |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 185 | case "$CMD" in |
| 186 | ls) |
| 187 | echo ls requested |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 188 | find $OSAAF -depth |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 189 | ;; |
| 190 | cat) |
| 191 | if [ "$1" = "" ]; then |
| 192 | echo "usage: cat <file... ONLY files ending in .props>" |
| 193 | else |
| 194 | if [[ $1 == *.props ]]; then |
| 195 | echo |
| 196 | echo "## CONTENTS OF $3" |
| 197 | echo |
| 198 | cat "$1" |
| 199 | else |
| 200 | echo "### ERROR ####" |
| 201 | echo " \"cat\" may only be used with files ending with \".props\"" |
| 202 | fi |
| 203 | fi |
| 204 | ;; |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 205 | validate) |
| 206 | echo "## validate requested" |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 207 | $JAVA_AAFCLI perm list user aaf@aaf.osaaf.org |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 208 | ;; |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 209 | onap) |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 210 | #echo Initializing ONAP configurations. |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 211 | ;; |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 212 | bash) |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 213 | shift |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 214 | cd $LOCAL || exit |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 215 | exec /bin/bash -c "$@" |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 216 | ;; |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 217 | setProp) |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 218 | cd $LOCAL || exit |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 219 | FILES=$(grep -l "$1" ./*.props) |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 220 | if [ -z "$FILES" ]; then |
| 221 | if [ -z "$3" ]; then |
| 222 | FILES=org.osaaf.aaf.props |
| 223 | else |
| 224 | FILES="$3" |
| 225 | fi |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 226 | ADD=Y |
| 227 | fi |
| 228 | for F in $FILES; do |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 229 | if [ "$ADD" = "Y" ]; then |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 230 | echo "Changing $1 for $F" |
Instrumental | aeb80c8 | 2018-08-21 10:24:08 -0500 | [diff] [blame] | 231 | echo "$1=$2" >> $F |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 232 | else |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 233 | echo "Changing $1 in $F" |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 234 | sed -i.backup -e "s/\\(${1}=\\).*/\\1${2}/" $F |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 235 | fi |
| 236 | cat $F |
| 237 | done |
| 238 | ;; |
| 239 | encrypt) |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 240 | cd $LOCAL || exit |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 241 | echo $1 |
| 242 | FILES=$(grep -l "$1" ./*.props) |
| 243 | if [ "$FILES" = "" ]; then |
Instrumental | bc299c0 | 2018-09-25 06:42:31 -0500 | [diff] [blame] | 244 | FILES=$LOCAL/org.osaaf.aaf.cred.props |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 245 | ADD=Y |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 246 | fi |
| 247 | for F in $FILES; do |
| 248 | echo "Changing $1 in $F" |
| 249 | if [ "$2" = "" ]; then |
| 250 | read -r -p "Password (leave blank to cancel): " -s ORIG_PW |
| 251 | echo " " |
| 252 | if [ "$ORIG_PW" = "" ]; then |
| 253 | echo canceling... |
| 254 | break |
| 255 | fi |
| 256 | else |
| 257 | ORIG_PW="$2" |
| 258 | fi |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 259 | PWD=$($JAVA_CADI digest "$ORIG_PW" $LOCAL/org.osaaf.aaf.keyfile) |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 260 | if [ "$ADD" = "Y" ]; then |
| 261 | echo "$1=enc:$PWD" >> $F |
| 262 | else |
| 263 | sed -i.backup -e "s/\\($1.*enc:\\).*/\\1$PWD/" $F |
| 264 | fi |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 265 | cat $F |
| 266 | done |
| 267 | ;; |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 268 | taillog) |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 269 | sh $OSAAF/logs/taillog |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 270 | ;; |
Instrumental | ca788dc | 2018-11-03 14:38:21 -0500 | [diff] [blame] | 271 | wait) |
| 272 | bash $CONFIG/bin/pod_wait.sh wait $1 |
| 273 | ;; |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 274 | --help | -?) |
| 275 | case "$1" in |
| 276 | "") |
| 277 | echo "--- Agent Container Comands ---" |
| 278 | echo " ls - Lists all files in Configuration" |
| 279 | echo " cat <file.props>> - Shows the contents (Prop files only)" |
| 280 | echo " validate - Runs a test using Configuration" |
Instrumental | 9c8a8b0 | 2018-07-16 18:41:10 -0500 | [diff] [blame] | 281 | echo " setProp <tag> [<value>] - set value on 'tag' (if no value, it will be queried from config)" |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 282 | echo " encrypt <tag> [<pass>] - set passwords on Configuration (if no pass, it will be queried)" |
| 283 | echo " bash - run bash in Container" |
| 284 | echo " Note: the following aliases are preset" |
| 285 | echo " cadi - CADI CmdLine tool" |
| 286 | echo " agent - Agent Java tool (see above help)" |
| 287 | echo "" |
| 288 | echo " --help|-? [cadi|agent] - This help, cadi help or agent help" |
| 289 | ;; |
| 290 | cadi) |
| 291 | echo "--- cadi Tool Comands ---" |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 292 | $JAVA_CADI |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 293 | ;; |
| 294 | agent) |
| 295 | echo "--- agent Tool Comands ---" |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 296 | $JAVA_AGENT |
| 297 | ;; |
| 298 | aafcli) |
| 299 | echo "--- aafcli Tool Comands ---" |
| 300 | $JAVA_AAFCLI |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 301 | ;; |
| 302 | esac |
| 303 | echo "" |
| 304 | ;; |
| 305 | *) |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 306 | $JAVA_AGENT "$CMD" "$@" cadi_prop_files=$LOCAL/org.osaaf.aaf.props |
Instrumental | 4ad4763 | 2018-07-13 15:49:26 -0500 | [diff] [blame] | 307 | ;; |
| 308 | esac |
| 309 | fi |