Instrumental | 32cdd55 | 2018-07-19 13:29:32 -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 | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 21 | # This script is run when starting client Container. |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 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 | # |
Instrumental | 4d0a045 | 2019-11-14 12:14:16 -0600 | [diff] [blame] | 24 | JAVA=${JAVA_HOME}/bin/java |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 25 | AAF_INTERFACE_VERSION=2.1 |
| 26 | |
| 27 | # Extract Name, Domain and NS from FQI |
| 28 | FQIA=($(echo ${APP_FQI} | tr '@' '\n')) |
| 29 | FQI_SHORT=${FQIA[0]} |
| 30 | FQI_DOMAIN=${FQIA[1]} |
| 31 | # Reverse DOMAIN for NS |
| 32 | FQIA_E=($(echo ${FQI_DOMAIN} | tr '.' '\n')) |
| 33 | for (( i=( ${#FQIA_E[@]} -1 ); i>0; i-- )); do |
| 34 | NS=${NS}${FQIA_E[i]}'.' |
| 35 | done |
| 36 | NS=${NS}${FQIA_E[0]} |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 37 | CONFIG="/opt/app/aaf_config" |
Instrumental | 4952530 | 2018-10-06 20:32:59 -0500 | [diff] [blame] | 38 | OSAAF="/opt/app/osaaf" |
| 39 | LOCAL="$OSAAF/local" |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 40 | DOT_AAF="$HOME/.aaf" |
| 41 | SSO="$DOT_AAF/sso.props" |
Instrumental | be7e0d1 | 2019-04-04 21:42:19 -0500 | [diff] [blame] | 42 | |
| 43 | if [ -e "$CONFIG" ]; then |
| 44 | CONFIG_BIN="$CONFIG/bin" |
| 45 | else |
| 46 | CONFIG_BIN="." |
| 47 | fi |
| 48 | |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 49 | AGENT_JAR="$CONFIG_BIN/aaf-cadi-aaf-*-full.jar" |
Instrumental | be7e0d1 | 2019-04-04 21:42:19 -0500 | [diff] [blame] | 50 | |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 51 | JAVA_AGENT="$JAVA -Dcadi_loglevel=DEBUG -Dcadi_etc_dir=${LOCAL} -Dcadi_log_dir=${LOCAL} -jar $AGENT_JAR " |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 52 | |
| 53 | # Setup SSO info for Deploy ID |
| 54 | function sso_encrypt() { |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 55 | $JAVA_AGENT cadi digest ${1} $DOT_AAF/keyfile |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 56 | } |
| 57 | |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 58 | # Setup Bash, first time only |
| 59 | if [ ! -e "$HOME/.bashrc" ] || [ -z "$(grep agent $HOME/.bashrc)" ]; then |
| 60 | echo "alias agent='$CONFIG_BIN/agent.sh agent \$*'" >>$HOME/.bashrc |
| 61 | chmod a+x $CONFIG_BIN/agent.sh |
| 62 | . $HOME/.bashrc |
| 63 | fi |
Instrumental | 4ac37bf | 2019-04-10 13:01:30 -0500 | [diff] [blame] | 64 | if [ ! -e "$DOT_AAF/truststoreONAPall.jks" ]; then |
| 65 | mkdir -p $DOT_AAF |
| 66 | base64 -d $CONFIG/cert/truststoreONAPall.jks.b64 > $DOT_AAF/truststoreONAPall.jks |
| 67 | fi |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 68 | |
Instrumental | 4952530 | 2018-10-06 20:32:59 -0500 | [diff] [blame] | 69 | # Create Deployer Info, located at /root/.aaf |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 70 | if [ ! -e "$DOT_AAF/keyfile" ]; then |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 71 | $JAVA_AGENT cadi keygen $DOT_AAF/keyfile |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 72 | chmod 400 $DOT_AAF/keyfile |
Instrumental | 69549ce | 2019-08-05 14:28:17 -0500 | [diff] [blame] | 73 | echo "cadi_keyfile=$DOT_AAF/keyfile" > ${SSO} |
Instrumental | 4ac37bf | 2019-04-10 13:01:30 -0500 | [diff] [blame] | 74 | |
| 75 | # Add Deployer Creds to Root's SSO |
| 76 | DEPLOY_FQI="${DEPLOY_FQI:=$app_id}" |
Instrumental | 69549ce | 2019-08-05 14:28:17 -0500 | [diff] [blame] | 77 | echo "aaf_id=${DEPLOY_FQI}" >> ${SSO} |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 78 | if [ ! "${DEPLOY_PASSWORD}" = "" ]; then |
| 79 | echo aaf_password=enc:$(sso_encrypt ${DEPLOY_PASSWORD}) >> ${SSO} |
| 80 | fi |
Instrumental | be7e0d1 | 2019-04-04 21:42:19 -0500 | [diff] [blame] | 81 | |
Instrumental | 4ac37bf | 2019-04-10 13:01:30 -0500 | [diff] [blame] | 82 | # Cover case where using app.props |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 83 | aaf_locator_container_ns=${aaf_locator_container_ns:=$CONTAINER_NS} |
| 84 | if [ "$aaf_locator_container" = "docker" ]; then |
| 85 | echo "aaf_locate_url=https://aaf-locate:8095" >> ${SSO} |
| 86 | echo "aaf_url_cm=https://aaf-cm:8150" >> ${SSO} |
| 87 | echo "aaf_url=https://aaf-service:8100" >> ${SSO} |
| 88 | else |
| 89 | echo "aaf_locate_url=https://$aaf-locator.${CONTAINER_NS}:8095" >> ${SSO} |
| 90 | echo "aaf_url_cm=https://AAF_LOCATE_URL/%CNS.%NS.cm:2.1" >> ${SSO} |
| 91 | echo "aaf_url=https://AAF_LOCATE_URL/%CNS.%NS.service:2.1" >> ${SSO} |
| 92 | fi |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 93 | |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 94 | echo "cadi_truststore=$DOT_AAF/truststoreONAPall.jks" >> ${SSO} |
| 95 | echo "cadi_truststore_password=changeit" >> ${SSO} |
| 96 | echo "cadi_latitude=${LATITUDE}" >> ${SSO} |
| 97 | echo "cadi_longitude=${LONGITUDE}" >> ${SSO} |
| 98 | echo "hostname=${aaf_locator_fqdn}" >> ${SSO} |
| 99 | |
| 100 | # Push in all AAF and CADI properties to SSO |
Instrumental | 4ac37bf | 2019-04-10 13:01:30 -0500 | [diff] [blame] | 101 | for E in $(env); do |
| 102 | if [ "${E:0:4}" = "aaf_" ] || [ "${E:0:5}" = "cadi_" ]; then |
| 103 | # Use Deployer ID in ${SSO} |
| 104 | if [ "app_id" != "${E%=*}" ]; then |
| 105 | S="${E/_helm/.helm}" |
| 106 | S="${S/_oom/.oom}" |
| 107 | echo "$S" >> ${SSO} |
| 108 | fi |
| 109 | fi |
| 110 | done |
| 111 | |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 112 | . ${SSO} |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 113 | echo "Caller Properties Initialized" |
| 114 | INITIALIZED="true" |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 115 | echo "cat SSO" |
| 116 | cat ${SSO} |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 117 | fi |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 118 | |
| 119 | # Check for local dir |
| 120 | if [ -d $LOCAL ]; then |
| 121 | echo "$LOCAL exists" |
| 122 | else |
| 123 | mkdir -p $LOCAL |
| 124 | echo "Created $LOCAL" |
| 125 | fi |
| 126 | |
| 127 | cd $LOCAL |
| 128 | echo "Existing files in $LOCAL" |
| 129 | ls -l |
Instrumental | f64f482 | 2019-04-30 10:19:21 -0500 | [diff] [blame] | 130 | |
| 131 | # Should we clean up? |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 132 | if [ "${VERSION}" != "$(cat ${LOCAL}/VERSION 2> /dev/null)" ]; then |
Instrumental | f64f482 | 2019-04-30 10:19:21 -0500 | [diff] [blame] | 133 | echo "Clean up directory ${LOCAL}" |
| 134 | rm -Rf ${LOCAL}/* |
| 135 | fi |
| 136 | echo "${VERSION}" > $LOCAL/VERSION |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 137 | |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 138 | echo "Namespace is ${NS}" |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 139 | # Only initialize once, automatically... |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 140 | if [ ! -e $LOCAL/${NS}.props ]; then |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 141 | echo "#### Create Configuration files " |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 142 | $JAVA_AGENT config $APP_FQI $APP_FQDN |
Instrumental | 4952530 | 2018-10-06 20:32:59 -0500 | [diff] [blame] | 143 | cat $LOCAL/$NS.props |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 144 | |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 145 | echo |
| 146 | echo "#### Certificate Authorization Artifact" |
Instrumental | 4ac37bf | 2019-04-10 13:01:30 -0500 | [diff] [blame] | 147 | # TMP=$(mktemp) |
| 148 | TMP=$LOCAL/agent.log |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 149 | $JAVA_AGENT read ${APP_FQI} ${APP_FQDN} | tee $TMP |
Instrumental | 4ac37bf | 2019-04-10 13:01:30 -0500 | [diff] [blame] | 150 | |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 151 | if [ -n "$(grep 'Namespace:' $TMP)" ]; then |
| 152 | echo "#### Place Certificates (by deployer)" |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 153 | $JAVA_AGENT place $APP_FQI $APP_FQDN |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 154 | |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 155 | if [ -z "$(grep cadi_alias $NS.cred.props)" ]; then |
| 156 | echo "FAILED to get Certificate" |
| 157 | INITIALIZED="false" |
| 158 | else |
| 159 | echo "Obtained Certificates" |
| 160 | echo "#### Validate Configuration and Certificate with live call" |
| 161 | $JAVA_AGENT validate cadi_prop_files=${NS}.props |
| 162 | INITIALIZED="true" |
| 163 | fi |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 164 | else |
| 165 | echo "#### Certificate Authorization Artifact must be valid to continue" |
| 166 | fi |
| 167 | rm $TMP |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 168 | else |
| 169 | INITIALIZED="true" |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 170 | fi |
| 171 | |
| 172 | # Now run a command |
| 173 | CMD=$2 |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 174 | if [ -z "$CMD" ]; then |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 175 | if [ -n "$INITIALIZED" ]; then |
| 176 | echo "Initialization complete" |
Instrumental | 284ad0a | 2018-10-24 07:01:09 -0500 | [diff] [blame] | 177 | fi |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 178 | else |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 179 | shift |
| 180 | shift |
| 181 | case "$CMD" in |
| 182 | ls) |
| 183 | echo ls requested |
| 184 | find /opt/app/osaaf -depth |
| 185 | ;; |
| 186 | cat) |
| 187 | if [ "$1" = "" ]; then |
| 188 | echo "usage: cat <file... ONLY files ending in .props>" |
| 189 | else |
| 190 | if [[ $1 == *.props ]]; then |
| 191 | echo |
| 192 | echo "## CONTENTS OF $3" |
| 193 | echo |
| 194 | cat "$1" |
| 195 | else |
| 196 | echo "### ERROR ####" |
| 197 | echo " \"cat\" may only be used with files ending with \".props\"" |
| 198 | fi |
| 199 | fi |
| 200 | ;; |
Instrumental | 69549ce | 2019-08-05 14:28:17 -0500 | [diff] [blame] | 201 | read) |
| 202 | echo "## Read Artifacts" |
| 203 | $JAVA_AGENT read $APP_FQI $APP_FQDN cadi_prop_files=${SSO} cadi_loglevel=INFO |
| 204 | ;; |
Instrumental | 87da9fe | 2018-07-19 16:44:02 -0500 | [diff] [blame] | 205 | showpass) |
| 206 | echo "## Show Passwords" |
Instrumental | 69549ce | 2019-08-05 14:28:17 -0500 | [diff] [blame] | 207 | $JAVA_AGENT showpass $APP_FQI $APP_FQDN cadi_prop_files=${SSO} cadi_loglevel=ERROR |
Instrumental | 87da9fe | 2018-07-19 16:44:02 -0500 | [diff] [blame] | 208 | ;; |
| 209 | check) |
Instrumental | bf3d307 | 2019-02-18 14:01:07 -0600 | [diff] [blame] | 210 | echo "## Check Certificate" |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 211 | echo "$JAVA_AGENT check $APP_FQI $APP_FQDN cadi_prop_files=${LOCAL}/${NS}.props" |
| 212 | $JAVA_AGENT check $APP_FQI $APP_FQDN cadi_prop_files=${LOCAL}/${NS}.props |
Instrumental | 87da9fe | 2018-07-19 16:44:02 -0500 | [diff] [blame] | 213 | ;; |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 214 | validate) |
| 215 | echo "## validate requested" |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 216 | $JAVA_AGENT validate $APP_FQI $APP_FQDN |
| 217 | ;; |
| 218 | place) |
| 219 | echo "## Renew Certificate" |
| 220 | $JAVA_AGENT place $APP_FQI $APP_FQDN cadi_prop_files=${SSO} |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 221 | ;; |
Instrumental | bf3d307 | 2019-02-18 14:01:07 -0600 | [diff] [blame] | 222 | renew) |
| 223 | echo "## Renew Certificate" |
Instrumental | b3a6814 | 2019-07-24 14:42:22 -0500 | [diff] [blame] | 224 | $JAVA_AGENT place $APP_FQI $APP_FQDN |
Instrumental | bf3d307 | 2019-02-18 14:01:07 -0600 | [diff] [blame] | 225 | ;; |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 226 | bash) |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 227 | shift |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 228 | cd $LOCAL || exit |
Instrumental | 12414fe | 2019-01-22 10:27:32 -0600 | [diff] [blame] | 229 | exec bash "$@" |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 230 | ;; |
| 231 | setProp) |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 232 | cd $LOCAL || exit |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 233 | FILES=$(grep -l "$1" ./*.props) |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 234 | if [ -z "$FILES" ]; then |
| 235 | if [ -z "$3" ]; then |
| 236 | FILES=${NS}.props |
| 237 | else |
| 238 | FILES="$3" |
| 239 | fi |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 240 | ADD=Y |
| 241 | fi |
| 242 | for F in $FILES; do |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 243 | if [ "$ADD" = "Y" ]; then |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 244 | echo "Changing $1 to $F" |
| 245 | echo "$1=$2" >> $F |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 246 | else |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 247 | echo "Changing $1 in $F" |
Instrumental | 6095e29 | 2018-09-06 13:27:15 -0500 | [diff] [blame] | 248 | sed -i.backup -e "s/\\(${1}.*=\\).*/\\1${2}/" $F |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 249 | fi |
| 250 | cat $F |
| 251 | done |
| 252 | ;; |
| 253 | encrypt) |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 254 | cd $LOCAL || exit |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 255 | echo $1 |
| 256 | FILES=$(grep -l "$1" ./*.props) |
| 257 | if [ "$FILES" = "" ]; then |
Instrumental | 365638c | 2018-10-01 15:26:03 -0500 | [diff] [blame] | 258 | FILES=$LOCAL/${NS}.cred.props |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 259 | ADD=Y |
| 260 | fi |
| 261 | for F in $FILES; do |
| 262 | echo "Changing $1 in $F" |
| 263 | if [ "$2" = "" ]; then |
| 264 | read -r -p "Password (leave blank to cancel): " -s ORIG_PW |
| 265 | echo " " |
| 266 | if [ "$ORIG_PW" = "" ]; then |
| 267 | echo canceling... |
| 268 | break |
| 269 | fi |
| 270 | else |
| 271 | ORIG_PW="$2" |
| 272 | fi |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 273 | PWD=$($JAVA_CADI digest "$ORIG_PW" $LOCAL/${NS}.keyfile) |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 274 | if [ "$ADD" = "Y" ]; then |
| 275 | echo "$1=enc:$PWD" >> $F |
| 276 | else |
| 277 | sed -i.backup -e "s/\\($1.*enc:\\).*/\\1$PWD/" $F |
| 278 | fi |
| 279 | cat $F |
| 280 | done |
| 281 | ;; |
| 282 | taillog) |
| 283 | sh /opt/app/osaaf/logs/taillog |
| 284 | ;; |
Instrumental | bd7def7 | 2019-04-03 08:25:28 -0500 | [diff] [blame] | 285 | testConnectivity|testconnectivity) |
| 286 | echo "--- Test Connectivity ---" |
Instrumental | be7e0d1 | 2019-04-04 21:42:19 -0500 | [diff] [blame] | 287 | $JAVA -cp $CONFIG_BIN/aaf-auth-cmd-*-full.jar org.onap.aaf.cadi.aaf.TestConnectivity $LOCAL/org.osaaf.aaf.props |
Instrumental | bd7def7 | 2019-04-03 08:25:28 -0500 | [diff] [blame] | 288 | ;; |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 289 | --help | -?) |
| 290 | case "$1" in |
| 291 | "") |
| 292 | echo "--- Agent Container Comands ---" |
| 293 | echo " ls - Lists all files in Configuration" |
| 294 | echo " cat <file.props>> - Shows the contents (Prop files only)" |
| 295 | echo " validate - Runs a test using Configuration" |
| 296 | echo " setProp <tag> [<value>] - set value on 'tag' (if no value, it will be queried from config)" |
| 297 | echo " encrypt <tag> [<pass>] - set passwords on Configuration (if no pass, it will be queried)" |
| 298 | echo " bash - run bash in Container" |
| 299 | echo " Note: the following aliases are preset" |
| 300 | echo " cadi - CADI CmdLine tool" |
| 301 | echo " agent - Agent Java tool (see above help)" |
| 302 | echo "" |
| 303 | echo " --help|-? [cadi|agent] - This help, cadi help or agent help" |
| 304 | ;; |
| 305 | cadi) |
| 306 | echo "--- cadi Tool Comands ---" |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 307 | $JAVA_CADI |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 308 | ;; |
| 309 | agent) |
| 310 | echo "--- agent Tool Comands ---" |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 311 | $JAVA_AGENT |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 312 | ;; |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 313 | aafcli) |
| 314 | echo "--- aafcli Tool Comands ---" |
| 315 | $JAVA_AAFCLI |
| 316 | ;; |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 317 | esac |
| 318 | echo "" |
| 319 | ;; |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 320 | ### Possible Dublin |
| 321 | # sample) |
| 322 | # echo "--- run Sample Servlet App ---" |
Instrumental | be7e0d1 | 2019-04-04 21:42:19 -0500 | [diff] [blame] | 323 | # $JAVA -Dcadi_prop_files=$LOCAL/${NS}.props -cp $CONFIG_BIN/aaf-auth-cmd-*-full.jar:$CONFIG_BIN/aaf-cadi-servlet-sample-*-sample.jar org.onap.aaf.sample.cadi.jetty.JettyStandalone ${NS}.props |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 324 | # ;; |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 325 | *) |
Instrumental | 9fe1153 | 2018-10-23 17:40:47 -0500 | [diff] [blame] | 326 | $JAVA_AGENT "$CMD" "$@" |
Instrumental | 32cdd55 | 2018-07-19 13:29:32 -0500 | [diff] [blame] | 327 | ;; |
| 328 | esac |
| 329 | fi |