summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
diff options
context:
space:
mode:
Diffstat (limited to 'os-plugins/plugins/vmgrid/files/run-vmgrid.sh')
-rw-r--r--os-plugins/plugins/vmgrid/files/run-vmgrid.sh21
1 files changed, 19 insertions, 2 deletions
diff --git a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
index a684310b..4fdd4af0 100644
--- a/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
+++ b/os-plugins/plugins/vmgrid/files/run-vmgrid.sh
@@ -289,11 +289,28 @@ vmostype=$(grep -io '<os param=.*"' ${xmlfile} | awk -F '"' '{ print $2 }' \
| tr [A-Z] [a-z])
# definition of the networking the client system is connected to
-network_kind=$(grep -io 'network param=.*"' ${xmlfile} \
+network_kind=$(grep -io '<network param=.*"' ${xmlfile} \
| awk -F '"' '{ print $2 }' | tr [A-Z] [a-z])
-network_card=$(grep -io 'netcard param=.*"' ${xmlfile} \
+network_card=$(grep -io '<netcard param=.*"' ${xmlfile} \
| awk -F '"' '{ print $2 }'| tr [A-Z] [a-z])
+# define redirects
+redirects=$(grep -ic '<redirect name=.*"' ${xmlfile})
+[ -z "${redirects}" ] && redirects=0
+(( i=1 ))
+while [ ${i} -le ${redirects} ]; do
+ # get only the $i-th line
+ redirect_name[$i]=$(grep -m ${i} -io '<redirect.*' ${xmlfile} | tail -n 1 \
+ | grep -o "name=\".*" | awk -F '"' '{ print $2 }')
+ redirect_proto[$i]=$(grep -m ${i} -io '<redirect.*' ${xmlfile} | tail -n 1 \
+ | grep -o "proto=\".*" | awk -F '"' '{ print $2 }')
+ redirect_hport[$i]=$(grep -m ${i} -io '<redirect.*' ${xmlfile} | tail -n 1 \
+ | grep -o "hostport=\".*" | awk -F '"' '{ print $2 }')
+ redirect_gport[$i]=$(grep -m ${i} -io '<redirect.*' ${xmlfile} | tail -n 1 \
+ | grep -o "guestport=\".*" | awk -F '"' '{ print $2 }')
+ (( i=$i+1 ))
+done
+
writelog "\tVirtualization:\t\t$xmlvirt"
writelog "\tVM name:\t\t$vm_name"
writelog "\tVM short name:\t\t$vm_shortname"