From 7da6ce0308474d0d47044fed38cceec0175dfb8c Mon Sep 17 00:00:00 2001 From: gryf Date: Mon, 23 Mar 2020 08:53:00 +0100 Subject: [PATCH] Added cleanup.sh --- bootstrap_centos7.sh | 1 + bootstrap_fedora31.sh | 1 + bootstrap_ubuntu.sh | 1 + cleanup.sh | 8 ++++++++ 4 files changed, 11 insertions(+) create mode 100755 cleanup.sh diff --git a/bootstrap_centos7.sh b/bootstrap_centos7.sh index e6fafce..00e7884 100755 --- a/bootstrap_centos7.sh +++ b/bootstrap_centos7.sh @@ -89,6 +89,7 @@ cp .tmux.conf ~/ echo "bind -t vi-copy 'v' begin-selection" >> ~/.tmux.conf echo "bind -t vi-copy 'y' copy-selection" >> ~/.tmux.conf cp .gitconfig ~/ +cp cleanup.sh ~/ echo '. ~/.bash_prompt' >> ~/.bashrc # 8. get my vim config diff --git a/bootstrap_fedora31.sh b/bootstrap_fedora31.sh index bddf66e..85c188a 100755 --- a/bootstrap_fedora31.sh +++ b/bootstrap_fedora31.sh @@ -41,6 +41,7 @@ fi sudo cp .bash_prompt ~/ sudo cp .tmux.conf ~/ sudo cp .gitconfig ~/ +cp cleanup.sh ~/ echo '. ~/.bash_prompt' >> ~/.bashrc # 7. get my vim config diff --git a/bootstrap_ubuntu.sh b/bootstrap_ubuntu.sh index cbd43f3..83abf16 100755 --- a/bootstrap_ubuntu.sh +++ b/bootstrap_ubuntu.sh @@ -68,6 +68,7 @@ cp .tmux.conf ~/ echo "bind-key -T copy-mode-vi 'v' send -X begin-selection" >> ~/.tmux.conf echo "bind-key -T copy-mode-vi 'y' send -X copy-selection" >> ~/.tmux.conf cp .gitconfig ~/ +cp cleanup.sh ~/ echo '. ~/.bash_prompt' >> ~/.bashrc # 7. get my vim config diff --git a/cleanup.sh b/cleanup.sh new file mode 100755 index 0000000..cd132e1 --- /dev/null +++ b/cleanup.sh @@ -0,0 +1,8 @@ +#!/bin/bash -x +~/devstack/unstack.sh +for instance in `sudo virsh list --all --name` +do sudo virsh destroy $instance + sudo virsh undefine $instance +done +sudo umount `mount | grep kube | cut -d " " -f 3` +sudo rm -rf /var/lib/docker && sudo rm -rf /opt/stack/data