sg481n | bd890c5 | 2017-08-28 12:11:35 -0400 | [diff] [blame] | 1 | #!/bin/sh
|
| 2 | ##############################################################################
|
| 3 | # - Copyright 2012, 2016 AT&T Intellectual Properties
|
| 4 | ############################################################################## |
| 5 | umask 022
|
| 6 | ROOT_DIR=${INSTALL_ROOT}/${distFilesRootDirPath}
|
| 7 |
|
| 8 | # Grab the IID of all resources running under the name and same version(s) we're working on and stop those instances
|
| 9 | ${LRM_HOME}/bin/lrmcli -running | \
|
| 10 | grep ${artifactId} | \
|
| 11 | grep ${version} | \
|
| 12 | cut -f1 | \
|
| 13 | while read _iid
|
| 14 | do
|
| 15 | if [ -n "${_iid}" ]; then
|
| 16 | ${LRM_HOME}/bin/lrmcli -shutdown -iid ${_iid} | grep SUCCESS
|
| 17 | if [ $? -ne 0 ]; then
|
| 18 | echo "$LRMID-{_iid} Shutdown failed"
|
| 19 | fi
|
| 20 | fi
|
| 21 | done
|
| 22 |
|
| 23 | # Grab the resources configured under the name and same version we're working on and delete those instances
|
| 24 | ${LRM_HOME}/bin/lrmcli -configured | \
|
| 25 | grep ${artifactId} | \
|
| 26 | grep ${version} | \
|
| 27 | cut -f1,2,3 | \
|
| 28 | while read _name _version _routeoffer
|
| 29 | do
|
| 30 | if [ -n "${_name}" ]; then
|
| 31 | ${LRM_HOME}/bin/lrmcli -delete -name ${_name} -version ${_version} -routeoffer ${_routeoffer} | grep SUCCESS
|
| 32 | if [ $? -ne 0 ]; then
|
| 33 | echo "${_version} Delete failed"
|
| 34 | fi
|
| 35 | fi
|
| 36 | done
|
| 37 |
|
| 38 | rm -rf ${ROOT_DIR}
|
| 39 |
|
| 40 | exit 0
|