3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-26 04:32:35 +01:00
pbot/applets/compiler_vm/host/devices/add-serials
2022-02-10 19:12:23 -08:00

27 lines
588 B
Bash
Executable File

#!/bin/sh
DOMAIN="${PBOTVM_DOMAIN:-pbot-vm}"
SERIAL="${PBOTVM_SERIAL:-5555}"
HEART="${PBOTVM_HEART:-5556}"
cat > serial-2.xml <<EOF
<serial type='tcp'>
<source mode='bind' host='127.0.0.1' service='$SERIAL' tls='no'/>
<protocol type='raw'/>
<target port='2'/>
</serial>
EOF
cat > serial-3.xml <<EOF
<serial type='tcp'>
<source mode='bind' host='127.0.0.1' service='$HEART' tls='no'/>
<protocol type='raw'/>
<target port='3'/>
</serial>
EOF
virsh attach-device --config $DOMAIN serial-2.xml
virsh attach-device --config $DOMAIN serial-3.xml
rm serial-[23].xml