From b1c5b50d4e87b6e83c6813da5db6f326e7ea8c33 Mon Sep 17 00:00:00 2001 From: Conor Schaefer Date: Thu, 11 Oct 2018 17:45:14 -0400 Subject: [PATCH] Updates destroy action Simplifies list-vms script via hardcoding Tried to avoid hardcoding, but got too clever. We'll wait for when we have tags for all VMs. --- Makefile | 3 +-- scripts/list-vms | 23 ++++++++++++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index c74d5de9..672d8fdd 100644 --- a/Makefile +++ b/Makefile @@ -81,8 +81,7 @@ remove-sd-svs: assert-dom0 ## Destroys SD SVS VM remove-sd-gpg: assert-dom0 ## Destroys SD GPG keystore VM @./scripts/destroy-vm sd-gpg -clean: assert-dom0 remove-sd-gpg remove-sd-svs remove-sd-journalist \ - remove-sd-svs-disp remove-sd-whonix clean-salt ## Destroys all SD VMs +clean: assert-dom0 destroy-all clean-salt ## Destroys all SD VMs test: assert-dom0 ## Runs all application tests (no integration tests yet) python -m unittest discover tests diff --git a/scripts/list-vms b/scripts/list-vms index e52ee2cf..a85696bd 100755 --- a/scripts/list-vms +++ b/scripts/list-vms @@ -5,10 +5,19 @@ set -e set -u set -o pipefail -# Search all top files for vm names declared as attributes -# assigned to dom0, strip out formatting. -grep dom0: dom0/*.top -A1 \ - | grep -v dom0: \ - | grep -v '^\-\-' \ - | perl -lanE 'print $F[-1]' \ - | sort +declare -a sd_workstation_vm_names=( + sd-gpg + sd-journalist + sd-journalist-template + sd-svs + sd-svs-template + sd-workstation-template + sd-whonix + sd-whonix-template + sd-svs-disp + sd-svs-disp-template +) + +for vm in "${sd_workstation_vm_names[@]}" ; do + echo "$vm" +done