added virtualbox cleanup on vm_pack_dist()

This commit is contained in:
parazyd 2017-02-15 15:42:57 +01:00
parent a2a1ecd2c5
commit 059a533ff7
No known key found for this signature in database
GPG Key ID: F0CB28FCF78637DE
3 changed files with 13 additions and 5 deletions

View File

@ -288,6 +288,6 @@ silly() {
"god is porco"
"A million hamsters are spinning their wheels right now"
)
local rnd=$(shuf -i1-30 -n 1)
local rnd=$(shuf -i1-$#funneh -n 1)
act "${funneh[$rnd]}" ; [[ $arg1 = sleep ]] && sleep $arg2
}

View File

@ -66,8 +66,8 @@ fe02::1 ip6-allrouters
EOF
}
conf_print_networkifaces() {
fn conf_print_networkifaces
conf_print_netifaces() {
fn conf_print_netifaces
cat <<EOF
# interfaces(5) file used by ifup(8) and ifdown(8)

View File

@ -112,7 +112,7 @@ vm_vbox_setup() {
act "creating vm"
VBoxManage createvm --name "$vmname" --ostype Debian_64 --register || zerr
act "setting up ram and group"
VBoxManage modifyvm "$vmname" --memory 256 --groups /personalcloud || zerr
VBoxManage modifyvm "$vmname" --memory 256 --groups /vmsdk || zerr
act "setting up storage"
VBoxManage storagectl "$vmname" --name "IDE Controller" --add ide || zerr
act "attaching storage"
@ -172,7 +172,15 @@ vm_pack_dist() {
silly
sha256sum $R/dist/${vm_name}.box > $R/dist/${vm_name}.box.sha
sha256sum $R/dist/${vm_name}.${imageformat} > $R/dist/${vm_name}.${imageformat}.sha
# TODO: XXX: cleanup vagrant/virtualbox leftovers
notice "cleaning up virtualbox leftovers"
pushd "$workdir"
VBoxManage unregistervm "$vmname" --delete
rm -f metadata.json Vagrantfile
rm -rf .vagrant
popd
rm -rf "$workdir"
rm -rf "$HOME/VirtualBox VMs/vmsdk"
notice "done!"
ls -1 $R/dist
}