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