diff options
author | Simon Rettberg | 2016-08-04 16:02:20 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-08-04 16:02:20 +0200 |
commit | b4ab4c58c014eb8985a885c0d2752bf7997e24ba (patch) | |
tree | 9d9b6f7a64aedca5df86510186079f09bfec9540 | |
parent | [run-virt] Implement automatic firewalling (diff) | |
download | tm-scripts-b4ab4c58c014eb8985a885c0d2752bf7997e24ba.tar.gz tm-scripts-b4ab4c58c014eb8985a885c0d2752bf7997e24ba.tar.xz tm-scripts-b4ab4c58c014eb8985a885c0d2752bf7997e24ba.zip |
[run-virt] Add lecture runscript to virtual floppy
-rw-r--r-- | remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc | 17 |
1 files changed, 16 insertions, 1 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 5f12fe29..9856f66a 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 @@ -5,6 +5,10 @@ declare -rg FLOPPYIMG="${TMPDIR}/floppy.img" declare -rg TMPHOME="${HOME}" +declare -rg RUNSCRIPT="${TMPDIR}/runscript.tmp" + +wget -T 6 -O "${RUNSCRIPT}" -nv "${SLX_VMCHOOSER_BASE_URL}/lecture/${IMGUUID}/runscript" & +WGET=$? dd "if=/dev/zero" "of=${FLOPPYIMG}" count=1440 bs=1024 chmod 0600 "${FLOPPYIMG}" @@ -66,8 +70,13 @@ 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 files into floppy image +# 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" "::/" # Copy guest configuration (with added information) config.xml to be accessed @@ -77,6 +86,12 @@ mcopy -i "${FLOPPYIMG}" "$xmlfile" "::/config.xml" # Copying linux directory: 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}" +fi + rm -f -- "${SHARES}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" unset SHARES VAR NETHOME UNAME |