5 jujuver=`juju --version`
7 if [[ "$jujuver" > "2" ]]; then
8 if [ ! -d labconfig.yaml ]; then
9 cp ~/joid_config/labconfig.yaml ./labconfig.yaml || true
10 if [ -d $HOME/joid_config/deployconfig.yaml ]; then
11 cp ~/joid_config/deployconfig.yaml ./deployconfig.yaml || true
13 python genDeploymentConfig.py -l labconfig.yaml > deployconfig.yaml
17 if [ ! -d environments.yaml ]; then
18 cp ~/joid_config/environments.yaml ./environments.yaml || true
19 cp ~/.juju/environments.yaml ./environments.yaml || true
24 if [[ "$jujuver" > "2" ]]; then
25 controllername=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
26 cloudname=`awk 'NR==1{print substr($1, 1, length($1)-1)}' deployconfig.yaml`
27 juju kill-controller $controllername --timeout 10s -y || true
32 sudo sysctl -w vm.drop_caches=3
33 elif [ -d $HOME/.juju/environments ]; then
35 juju status &>>status.txt || true
36 if [ "$(grep -c "environment is not bootstrapped" status.txt )" -ge 1 ]; then
37 echo " environment is not bootstrapped ..."
39 echo " environment is bootstrapped ..."
40 jujuenv=`juju status | grep environment | cut -d ":" -f 2`
41 juju destroy-environment $jujuenv -y || true
47 rm -rf $HOME/.juju/.deployer-store-cache
48 rm -rf $HOME/.juju/environments
49 rm -rf $HOME/.juju/ssh
50 sudo sysctl -w vm.drop_caches=3