mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-22 11:59:43 +01:00
compiler_vm: add-serials now uses HEREDOC for templating
This commit is contained in:
parent
e217fb15d5
commit
563dc8c70a
@ -4,12 +4,23 @@ DOMAIN="${PBOTVM_DOMAIN:-pbot-vm}"
|
|||||||
SERIAL="${PBOTVM_SERIAL:-5555}"
|
SERIAL="${PBOTVM_SERIAL:-5555}"
|
||||||
HEART="${PBOTVM_HEART:-5556}"
|
HEART="${PBOTVM_HEART:-5556}"
|
||||||
|
|
||||||
install_serial() {
|
cat > serial-2.xml <<EOF
|
||||||
file=$1 port=$2
|
<serial type='tcp'>
|
||||||
sed -i.1 "s/[\$]PORT[\$]/$port/" $file
|
<source mode='bind' host='127.0.0.1' service='$SERIAL' tls='no'/>
|
||||||
virsh attach-device --config $DOMAIN $file
|
<protocol type='raw'/>
|
||||||
mv $file.1 $file
|
<target port='2'/>
|
||||||
}
|
</serial>
|
||||||
|
EOF
|
||||||
|
|
||||||
install_serial serial-2.xml $SERIAL
|
cat > serial-3.xml <<EOF
|
||||||
install_serial serial-3.xml $HEART
|
<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
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
<serial type='tcp'>
|
|
||||||
<source mode='bind' host='127.0.0.1' service='$PORT$' tls='no'/>
|
|
||||||
<protocol type='raw'/>
|
|
||||||
<target port='2'/>
|
|
||||||
</serial>
|
|
@ -1,5 +0,0 @@
|
|||||||
<serial type='tcp'>
|
|
||||||
<source mode='bind' host='127.0.0.1' service='$PORT$' tls='no'/>
|
|
||||||
<protocol type='raw'/>
|
|
||||||
<target port='3'/>
|
|
||||||
</serial>
|
|
Loading…
Reference in New Issue
Block a user