From 563dc8c70ad29b4ed928787d0e698cb7087448e8 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 10 Feb 2022 19:12:23 -0800 Subject: [PATCH] compiler_vm: add-serials now uses HEREDOC for templating --- applets/compiler_vm/host/devices/add-serials | 27 +++++++++++++------ applets/compiler_vm/host/devices/serial-2.xml | 5 ---- applets/compiler_vm/host/devices/serial-3.xml | 5 ---- 3 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 applets/compiler_vm/host/devices/serial-2.xml delete mode 100644 applets/compiler_vm/host/devices/serial-3.xml diff --git a/applets/compiler_vm/host/devices/add-serials b/applets/compiler_vm/host/devices/add-serials index 26d143ca..aaebf5b9 100755 --- a/applets/compiler_vm/host/devices/add-serials +++ b/applets/compiler_vm/host/devices/add-serials @@ -4,12 +4,23 @@ DOMAIN="${PBOTVM_DOMAIN:-pbot-vm}" SERIAL="${PBOTVM_SERIAL:-5555}" HEART="${PBOTVM_HEART:-5556}" -install_serial() { - file=$1 port=$2 - sed -i.1 "s/[\$]PORT[\$]/$port/" $file - virsh attach-device --config $DOMAIN $file - mv $file.1 $file -} +cat > serial-2.xml < + + + + +EOF -install_serial serial-2.xml $SERIAL -install_serial serial-3.xml $HEART +cat > serial-3.xml < + + + + +EOF + +virsh attach-device --config $DOMAIN serial-2.xml +virsh attach-device --config $DOMAIN serial-3.xml + +rm serial-[23].xml diff --git a/applets/compiler_vm/host/devices/serial-2.xml b/applets/compiler_vm/host/devices/serial-2.xml deleted file mode 100644 index 7d9e08ef..00000000 --- a/applets/compiler_vm/host/devices/serial-2.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/applets/compiler_vm/host/devices/serial-3.xml b/applets/compiler_vm/host/devices/serial-3.xml deleted file mode 100644 index 34f0e1b7..00000000 --- a/applets/compiler_vm/host/devices/serial-3.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - -