diff options
author | Michael Janczyk | 2010-04-20 20:44:28 +0200 |
---|---|---|
committer | Michael Janczyk | 2010-04-20 20:44:28 +0200 |
commit | bdf81fac4346f25eb11ce4834afc5d918a6f92d1 (patch) | |
tree | b8ebafb5fdb32aa77dfe43be3b85eb11c450d373 /os-plugins/plugins/virtualbox/files/run-virt.include | |
parent | Merge branch 'master' into vmgrid (diff) | |
download | core-bdf81fac4346f25eb11ce4834afc5d918a6f92d1.tar.gz core-bdf81fac4346f25eb11ce4834afc5d918a6f92d1.tar.xz core-bdf81fac4346f25eb11ce4834afc5d918a6f92d1.zip |
now different port forwards can be submitted via xml, to be tested
Diffstat (limited to 'os-plugins/plugins/virtualbox/files/run-virt.include')
-rw-r--r-- | os-plugins/plugins/virtualbox/files/run-virt.include | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/os-plugins/plugins/virtualbox/files/run-virt.include b/os-plugins/plugins/virtualbox/files/run-virt.include index b2c55c0d..119b1e16 100644 --- a/os-plugins/plugins/virtualbox/files/run-virt.include +++ b/os-plugins/plugins/virtualbox/files/run-virt.include @@ -340,19 +340,21 @@ if [ ${diskless} -eq 1 ]; then sed -i "/<!-- PLEASE DO NOT REMOVE THIS COMMENT!!! -->/d" ${machconfig} fi -# add ssh port if Linux26* and NAT -if echo "${vmostype}" | grep -q "Linux26" && [ "${network_kind}" = "NAT" ]; then - vmsshport="220${VM_ID}" - extradataitem='<ExtraDataItem name="VBoxInternal/Devices' \ - extradataitem="${extradataitem}/${network_card}/0/LUN#0/Config/ssh/" - extradataguestport='GuestPort" value="22"/>' - extradatahostport="HostPort\" value=\"${vmsshport}\"/>" - extradataprotocol='Protocol" value="TCP"/>' - sed -i "s,</ExtraData>, ${extradataitem}${extradataguestport}\n\ - ${extradataitem}${extradatahostport}\n\ - ${extradataitem}${extradataprotocol}\n\ - </ExtraData>," "${machconfig}" - writelog "\tGuest SSH port:\t\t${vmsshport}" +# define redirects +if [ -n "${redirects}" ]; then + (( i=1 )) + while [ ${i} -le ${redirects} ]; do + extradataitem='<ExtraDataItem name="VBoxInternal/Devices' + extradataitem="${extradataitem}/${network_card}/0/LUN#0/Config" + extradataitem="${extradataitem}/${redirect_name[$i]}/" + extradataprotocol="Protocol\" value=\"${redirect_proto[$i]}\"/>" + extradatahostport="HostPort\" value=\"${redirect_hport[$i]}\"/>" + extradataguestport="GuestPort\" value=\"${redirect_gport[$i]}\"/>" + sed -i "s,</ExtraData>, ${extradataitem}${extradataguestport}\n\ + ${extradataitem}${extradatahostport}\n\ + ${extradataitem}${extradataprotocol}\n\ + </ExtraData>," "${machconfig}" + writelog "\tGuest ${redirect_name[$i]} port:\t\t${redirect_hport[$i]}" fi ################################################################################ |