-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreinstall.sh
executable file
·40 lines (28 loc) · 987 Bytes
/
reinstall.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
#save current directory
starting_dir=$(pwd)
source ./scripts/constants.sh
read -p "Are you sure that you want to delete the VM named '${active_deployment_setting}' and reinstall it? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
#echo "Please enter your administrator password:"
#destroy dendro vm
info "Deleting all *.vmdk in $starting_dir"
rm $starting_dir/*.vmdk
info "Deleting all *.vdi in $starting_dir"
rm $starting_dir/*.vdi
[[ "$active_deployment_setting" -ne "" ]]
info "Active dep setting not empty? $?"
[[ -d "$HOME/VirtualBox VMs/$active_deployment_setting" ]]
info "Folder exists? $?"
if [ "$active_deployment_setting" != "" ] && [ -d "$HOME/VirtualBox VMs/$active_deployment_setting" ];
then
rm -rf "$HOME/VirtualBox VMs/$active_deployment_setting"
fi
source ./define_env_vars.sh
info "Removing existing ${active_deployment_setting} VM..."
source ./uninstall.sh
info "Starting new VM setup..."
source ./install.sh
fi