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