From 32c4e15e3d773ebbce11ffe3af69bcb2f576eb30 Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Tue, 26 Apr 2022 16:53:34 +0200 Subject: [PATCH] Add a simple script to manage all the machines --- manage_all.sh | 21 +++++++++++++++++++++ templates/interfaces | 1 + 2 files changed, 22 insertions(+) create mode 100644 manage_all.sh diff --git a/manage_all.sh b/manage_all.sh new file mode 100644 index 0000000..ae4c59f --- /dev/null +++ b/manage_all.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -exu + +for vm in output/*/; do + case "$1" in + 'start') + ( cd "$vm" && ./qemu.sh ) & + ;; + 'stop') + echo system_powerdown | ncat -U "$vm/monitor.sock" + ;; + 'attach') + remote-viewer "spice+unix://./$vm/spice.sock" + ;; + *) + echo >&2 "Usage: $0 (start | stop | attach)" + exit 1 + ;; + esac +done diff --git a/templates/interfaces b/templates/interfaces index 303535e..6684108 100644 --- a/templates/interfaces +++ b/templates/interfaces @@ -4,6 +4,7 @@ iface lo inet loopback {% for br in c.bridges %} auto net_{{ br.num }} iface net_{{br.num}} inet static + pre-up nameif -s address 172.23.{{ br.num }}.{{ c.num }}/24 {% endfor %}