5 if [ ! -d environments.yaml ]; then
6 cp ~/joid_config/environments.yaml ./environments.yaml
9 jujuver=`juju --version`
11 if [ "$jujuver" -ge "2" ]; then
12 controllername=`awk 'NR==1{print $2}' environments.yaml`
13 cloudname=`awk 'NR==1{print $2}' environments.yaml`
14 juju kill-controller $controllername --timeout 10s -y || true
18 elif [ -d $HOME/.juju/environments ]; then
20 juju status &>>status.txt || true
21 if [ "$(grep -c "environment is not bootstrapped" status.txt )" -ge 1 ]; then
22 echo " environment is not bootstrapped ..."
24 echo " environment is bootstrapped ..."
25 jujuenv=`juju status | grep environment | cut -d ":" -f 2`
26 juju destroy-environment $jujuenv -y || true
32 rm -rf $HOME/.juju/.deployer-store-cache
33 rm -rf $HOME/.juju/environments
34 rm -rf $HOME/.juju/ssh