2022-02-11 01:30:11 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
DOMAIN="${PBOTVM_DOMAIN:-pbot-vm}"
|
|
|
|
SERIAL="${PBOTVM_SERIAL:-5555}"
|
pbot-vm: massive refactor
* replace heartbeat with health-check
* instead of steady stream of newlines every 5s, now awaits input
and responds with `vmstat` output
* more reliably use host/config/vm-exec.json to get libvirt domain name
for snapshot-revert, server address, serial ports, vagrant setting, etc
* use iptables/nftables to disable networking
* added guest/bin/disable-network-[iptables,nftables]
* added guest/bin/enable-network-[iptables,nftables]
* replace ugly ___OUTPUT___ texts in sh, bash, ksh, zsh languages
* documentation updates and tweaks
2024-04-10 10:21:18 +02:00
|
|
|
HEALTH="${PBOTVM_HEALTH:-5556}"
|
2022-02-11 01:30:11 +01:00
|
|
|
|
2022-02-11 04:12:23 +01:00
|
|
|
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'>
|
pbot-vm: massive refactor
* replace heartbeat with health-check
* instead of steady stream of newlines every 5s, now awaits input
and responds with `vmstat` output
* more reliably use host/config/vm-exec.json to get libvirt domain name
for snapshot-revert, server address, serial ports, vagrant setting, etc
* use iptables/nftables to disable networking
* added guest/bin/disable-network-[iptables,nftables]
* added guest/bin/enable-network-[iptables,nftables]
* replace ugly ___OUTPUT___ texts in sh, bash, ksh, zsh languages
* documentation updates and tweaks
2024-04-10 10:21:18 +02:00
|
|
|
<source mode='bind' host='127.0.0.1' service='$HEALTH' tls='no'/>
|
2022-02-11 04:12:23 +01:00
|
|
|
<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
|