3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-25 12:12:34 +01:00
pbot/applets/compiler_vm/host/devices/add-serials
2022-02-10 16:30:11 -08:00

16 lines
333 B
Bash
Executable File

#!/bin/sh
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
}
install_serial serial-2.xml $SERIAL
install_serial serial-3.xml $HEART