summaryrefslogtreecommitdiffstats
path: root/remote/modules/run-virt/data/opt/openslx/scripts
diff options
context:
space:
mode:
authorSimon Rettberg2016-10-05 13:17:30 +0200
committerSimon Rettberg2016-10-05 13:17:30 +0200
commitb14ba5392a5d05156c824ee722c85217a684e0a6 (patch)
treed9d9dbf1c33fea3ff420d00abbd1a51223fe7780 /remote/modules/run-virt/data/opt/openslx/scripts
parent[pvs2] Implement hybrid mode where the manager is running on the second virtu... (diff)
downloadtm-scripts-b14ba5392a5d05156c824ee722c85217a684e0a6.tar.gz
tm-scripts-b14ba5392a5d05156c824ee722c85217a684e0a6.tar.xz
tm-scripts-b14ba5392a5d05156c824ee722c85217a684e0a6.zip
[run-virt] Finish support for runscript in openslx.exe and setup_virtual_floppy
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/scripts')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc20
1 files changed, 12 insertions, 8 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
index 3fd5c109..d9ae052c 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
@@ -50,7 +50,16 @@ else
done
fi
-# Info file
+wait "$WGET"
+
+# Check downloaded runscript, handle extension marker
+EXT=
+if [ -s "$RUNSCRIPT" ]; then
+ EXT=$(head -n 1 "$RUNSCRIPT" | grep -o -i '^EXT=.*$' | cut -d '=' -f 2-)
+ [ -n "$EXT" ] && [ "x${EXT:0:1}" != "x." ] && EXT=".$EXT"
+fi
+
+# Write info file
UNAME=
[ -s "${HOME}/.account" ] && UNAME=$(cat "${HOME}/.account")
[ -z "${UNAME}" ] && UNAME=$(whoami)
@@ -61,6 +70,7 @@ resolution=${RESOLUTION}
createMissingRemap=${SHARE_CREATE_MISSING_REMAP}
remapMode=${SHARE_REMAP_MODE_INI}
homeDrive=${SHARE_HOME_DRIVE}
+scriptExt=${EXT}
[remap]
documents=${SHARE_DOCUMENTS}
@@ -70,12 +80,6 @@ media=${SHARE_MEDIA}
other=${SHARE_OTHER}
HIER
-wait "$WGET"
-EXT=
-if [ -s "$RUNSCRIPT" ]; then
- EXT=$(head -n 1 "$RUNSCRIPT" | grep -o -i '^EXT=.*$' | cut -d '=' -f 2-)
-fi
-
# Copy all them there filez into floppy image
mcopy -i "${FLOPPYIMG}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" "${SHARES}" "::/"
mcopy -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/openslx.exe" "::/"
@@ -89,7 +93,7 @@ mcopy -s -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/linux" "::/"
# User supplied runscript
if [ -n "$EXT" ]; then
sed -i '1d' "${RUNSCRIPT}"
- mcopy -i "${FLOPPYIMG}" "${RUNSCRIPT}" "::/runscript.${EXT}"
+ mcopy -i "${FLOPPYIMG}" "${RUNSCRIPT}" "::/runscript${EXT}"
fi
rm -f -- "${SHARES}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT"