fix syntax error and clean the clean.sh
[joid.git] / ci / clean.sh
1 #!/bin/bash
2
3 set -ex
4
5 if [ -d "~/.juju/environemnts" ]; then
6     juju status  &>status.txt || true
7     if [ "$(grep -c "environment is not bootstrapped" status.txt )" -ge 1 ]; then
8         echo " environment is not bootstrapped ..."
9     else
10         echo " environment is bootstrapped ..."
11         juju destroy-environment demo-maas  -y
12         rm -rf ~/.juju/j*
13         rm -rf ~/.juju/.deployer-store-cache
14     fi
15     rm -rf ~/.juju/environments
16     rm -rf ~/.juju/ssh
17 fi
18