blob: d18eebe662efbdc0ff0ae5584d6a73c669489f31 [file] [log] [blame]
David K. Bainbridgef3071012016-08-04 09:29:55 -07001#!/bin/bash
2
3J=$(which juju)
4
5if [ ! -z $J ]; then
6 juju remove-machine --force 12
7 juju remove-machine --force 11
8 juju remove-machine --force 10
9
10 RETRY=30
11 while [ $RETRY -gt 0 -a $(juju status --format=tabular | grep "^10\|^11\|^12" | wc -l) -ne 0 ]; do
12 echo -n "."
13 RETRY=$(expr $RETRY - 1)
14 sleep 2
15 done
16 echo
17fi
18
19UVT=$(which uvt-kvm)
20test -z $UVT || uvt-kvm list | xargs uvt-kvm destroy
21
David K. Bainbridge8b179042016-11-30 15:38:42 -080022LXC=$(which lxc)
23test -z $LXC || lxc delete --force $(lxc list | grep "^| [^ ]" | awk '{print $2}')
24
David K. Bainbridge7ae4f192016-09-29 09:01:38 -070025sudo apt-get remove --purge -y $(dpkg --get-selections | grep "nagioas\|juju\|nova\|neutron" | awk '{print $1}') &&sudo apt-get autoremove -y && sudo rm -rf /etc/juju /etc/neutron /home/ubuntu/.juju && sudo find / -name "*juju*" -exec rm -r \{\} \; && sudo rm -f /var/lib/uvtool/libvirt/images/*
David K. Bainbridgef3071012016-08-04 09:29:55 -070026
David K. Bainbridge0a7cdbb2017-07-14 11:36:13 -070027sudo rm -rf \
28 /opt/cord* \
29 /opt/onos_* \
30 /opt/credentials \
31 /opt/images
32
David K. Bainbridgef3071012016-08-04 09:29:55 -070033OVS=$(which ovs-vsctl)
34
35if [ ! -z $OVS ]; then
36 sudo ovs-vsctl del-br br-int
37fi
38
39sudo ifdown fabric
40sleep 3
41sudo ifup eth0
42sleep 3
43
44IP=$(ifconfig fabric | grep "inet addr" | awk '{print $2}' | cut -d: -f2)
45
46case $(echo "$IP" | cut -d. -f3) in
47 1)
48 TO=$(echo "$IP" | awk -F. '{printf("%s.%s.2.0/24", $1, $2)}')
49 GW=$(echo "$IP" | awk -F. '{printf("%s.%s.%s.254", $1, $2, $3)}')
50 ;;
51 2)
52 TO=$(echo "$IP" | awk -F. '{printf("%s.%s.1.0/24", $1, $2)}')
53 GW=$(echo "$IP" | awk -F. '{printf("%s.%s.%s.254", $1, $2, $3)}')
54 ;;
55esac
56
57sudo route add -net $TO gw $GW