blob: 740564ce2ffd395ce87b40161659deb8b878d646 [file] [log] [blame]
sg481nbd890c52017-08-28 12:11:35 -04001#!/bin/sh
2##############################################################################
3# - Copyright 2012, 2016 AT&T Intellectual Properties
4##############################################################################
5umask 022
6ROOT_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 | \
13while read _iid
14do
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
21done
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 | \
28while read _name _version _routeoffer
29do
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
36done
37
38rm -rf ${ROOT_DIR}
39
40exit 0