summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
authorSimon Rettberg2016-04-08 15:35:56 +0200
committerSimon Rettberg2016-04-08 15:35:56 +0200
commit673ecc725fa3a369d51a3439e8676885797e6ec3 (patch)
tree90c126c32597292992335d006ac1dfb1e9083295 /remote/modules
parent[run-virt] Revert config.xml and hostres.txt for backwards compatibility (diff)
downloadtm-scripts-673ecc725fa3a369d51a3439e8676885797e6ec3.tar.gz
tm-scripts-673ecc725fa3a369d51a3439e8676885797e6ec3.tar.xz
tm-scripts-673ecc725fa3a369d51a3439e8676885797e6ec3.zip
[run-virt] Add username field to openslx.ini
Diffstat (limited to 'remote/modules')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc38
1 files changed, 22 insertions, 16 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 ee737ed3..9d46f78f 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
@@ -22,21 +22,6 @@ fi
RESOLUTION=$(xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' \
| grep -o -E -m1 '[0-9]+x[0-9]+')
-cat > "${TMPDIR}/openslx.ini" <<-HIER
-[openslx]
-resolution=${RESOLUTION}
-createMissingRemap=${SHARE_CREATE_MISSING_REMAP}
-remapMode=${SHARE_REMAP_MODE_INI}
-homeDrive=${SHARE_HOME_DRIVE}
-
-[remap]
-documents=${SHARE_DOCUMENTS}
-downloads=${SHARE_DOWNLOADS}
-desktop=${SHARE_DESKTOP}
-media=${SHARE_MEDIA}
-other=${SHARE_OTHER}
-HIER
-
# Legacy: HOSTRES.TXT
cat > "${TMPDIR}/HOSTRES.TXT" <<-HIER
${RESOLUTION}
@@ -61,6 +46,27 @@ else
done
fi
+# Info file
+UNAME=
+[ -s "${HOME}/.account" ] && UNAME=$(cat "${HOME}/.account")
+[ -z "${UNAME}" ] && UNAME=$(whoami)
+cat > "${TMPDIR}/openslx.ini" <<-HIER
+[openslx]
+username=${UNAME}
+resolution=${RESOLUTION}
+createMissingRemap=${SHARE_CREATE_MISSING_REMAP}
+remapMode=${SHARE_REMAP_MODE_INI}
+homeDrive=${SHARE_HOME_DRIVE}
+
+[remap]
+documents=${SHARE_DOCUMENTS}
+downloads=${SHARE_DOWNLOADS}
+desktop=${SHARE_DESKTOP}
+media=${SHARE_MEDIA}
+other=${SHARE_OTHER}
+HIER
+
+
# Copy all them files into floppy image
mcopy -i "${FLOPPYIMG}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" "${SHARES}" "::/"
mcopy -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/openslx.exe" "::/"
@@ -69,5 +75,5 @@ mcopy -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/openslx.exe" "::/"
mcopy -i "${FLOPPYIMG}" "$xmlfile" "::/config.xml"
rm -f -- "${SHARES}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT"
-unset SHARES VAR NETHOME
+unset SHARES VAR NETHOME UNAME