summaryrefslogtreecommitdiffstats
path: root/remote/modules/run-virt/data/opt/openslx/scripts
diff options
context:
space:
mode:
authorSimon Rettberg2016-04-05 15:14:38 +0200
committerSimon Rettberg2016-04-05 15:14:38 +0200
commit807cd6d3b2698276edb19e9508cfe7445752ae9f (patch)
treece863b3cd5c378ba929e0e77eefb3e70d6353bbd /remote/modules/run-virt/data/opt/openslx/scripts
parent[vmware] Only enable VT-x virtualization for hwversion >= 9 (diff)
downloadtm-scripts-807cd6d3b2698276edb19e9508cfe7445752ae9f.tar.gz
tm-scripts-807cd6d3b2698276edb19e9508cfe7445752ae9f.tar.xz
tm-scripts-807cd6d3b2698276edb19e9508cfe7445752ae9f.zip
[run-virt/*] Introduce variable for downloaded vm config (was $TMPDIR/$IMGUUID)
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/scripts')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc
index fb64d73e..f77e955b 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/detect_legacy.inc
@@ -8,7 +8,8 @@
writelog "Detecting current/legacy mode ..."
# First, let's try to extract an imguuid from xmlfile:
-IMGUUID=$(grep -io '<uuid param=.*"' "${xmlfile}" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')
+declare -rg IMGUUID=$(grep -i -o '<uuid param=.*"' "${xmlfile}" | sed -e "s/&.*;/; /g" | awk -F '"' '{ print $2 }')
+declare -rg TMPCONFIG="$TMPDIR/vmconfig.tmp"
writelog "IMGUUID extracted: $IMGUUID"
@@ -18,11 +19,11 @@ if [ -z "$IMGUUID" ]; then # Keine uuid: Abbruch, Legacy
writelog "Could not extract a uuid param from ${xmlfile}. Triggering legacy mode."
else
# Now getting template file:
- if ! wget -O "$TMPDIR/$IMGUUID" "${SLX_VMCHOOSER_BASE_URL}/lecture/${IMGUUID}" 2>/dev/null >&2; then
+ if ! wget -O "$TMPCONFIG" "${SLX_VMCHOOSER_BASE_URL}/lecture/${IMGUUID}" 2>/dev/null >&2; then
writelog "wget ${SLX_VMCHOOSER_BASE_URL}/lecture/${IMGUUID}. Triggering legacy mode."
else
writelog "wget ${SLX_VMCHOOSER_BASE_URL}/lecture/${IMGUUID} successful."
- if [ ! -s "$TMPDIR/$IMGUUID" ]; then
+ if [ ! -s "$TMPCONFIG" ]; then
writelog "Server sent zero byte virtual machine description file. Triggering legacy mode."
else
writelog "Triggering current (non-legacy) mode."