Lucio Lelii 7 years ago
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…
Cancel
Save