git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/distributions/smartgears-distribution@146408 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
05ebda1c21
commit
8c543f3916
|
@ -1,9 +1,9 @@
|
|||
#!/bin/bashin
|
||||
#!/bin/bash
|
||||
|
||||
function showhelp {
|
||||
echo -e "\nusage: clean-container-state [-g <ghn_home>] [-s <fileName>] [-h] \n"
|
||||
echo " ghn_home = the gHN directory.\n"
|
||||
echo " fileName = the filename for volatile state.\n"
|
||||
echo " fileName = the filename for volatile state.\n"
|
||||
echo -e " h = shows this help.\n"
|
||||
}
|
||||
|
||||
|
@ -40,20 +40,27 @@ echo -e "\nRemoving resource profiles from the Information System\n"
|
|||
|
||||
source "$ghnhome"/scripts/load-env
|
||||
|
||||
|
||||
RETVAL=
|
||||
if [ -z "$filename" ]; then
|
||||
java org.gcube.smartgears.utils.sweeper.ContainerSweeperClient 1>/dev/null
|
||||
RETVAL=$?
|
||||
else
|
||||
java org.gcube.smartgears.utils.sweeper.ContainerSweeperClient $filename 1>/dev/null
|
||||
echo -e "\nvolatile state saved in $ghnhome/$filename"
|
||||
RETVAL=$?
|
||||
if [ $RETVAL -eq 0 ] ; then
|
||||
echo -e "\nvolatile state saved in $ghnhome/$filename"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e "\nCould no correctly sweep the profiles from the Information System"
|
||||
echo -e "\nIn case of production deployment please contact the production admin"
|
||||
echo -e "\nIn case of dev deployment you can remove the state by hand by removing the $GHN_HOME/state folder"
|
||||
exit 1
|
||||
if [ $RETVAL -ne 0 ]; then
|
||||
echo -e "\nCould no correctly sweep the profiles from the Information System"
|
||||
echo -e "\nIn case of production deployment please contact the production admin"
|
||||
echo -e "\nIn case of dev deployment you can remove the state by hand by removing the $GHN_HOME/state folder"
|
||||
else
|
||||
echo "Removing container state $ghnhome"
|
||||
# removing folder
|
||||
rm -rf $ghnhome/state
|
||||
fi
|
||||
|
||||
echo "Removing container state $ghnhome"
|
||||
#removing folder
|
||||
rm -rf $ghnhome/state
|
||||
exit $RETVAL
|
Loading…
Reference in New Issue