From c7ed45225fa986341280ba3e2ebcf7cb9e1f3ee2 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 21 Nov 2018 12:23:32 +0100 Subject: [run-virt] Support lecture-specific sound muting --- .../opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d') diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc index ba421191..e2854f77 100644 --- a/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc +++ b/core/modules/run-virt/data/opt/openslx/vmchooser/run-virt.d/setup_virtual_floppy.inc @@ -100,12 +100,12 @@ setup_virtual_floppy() { fi ## Runscript + declare -A OPTIONS # Check downloaded runscript and handle options like # extension, visibility flag, ... # options are 'key=value' pairs separated with ';' if load_dmsd_resource RUNSCRIPT; then if [ -s "$RUNSCRIPT" ]; then - declare -A OPTIONS IFS=$'\n' for OPT in $(head -n 1 "$RUNSCRIPT" | tr ";" "\n"); do KEY=$(cut -s -d '=' -f 1 <<< "${OPT^^}") @@ -117,8 +117,14 @@ setup_virtual_floppy() { fi fi + # Default to muted local MUTED=1 + # Satellite/location setting can override [ -n "$SLX_VM_MUTED" ] && [ "$SLX_VM_MUTED" -ge 0 ] && MUTED="$SLX_VM_MUTED" + # finally, lecture can override + if [ -n "${OPTIONS[SOUNDMUTED]}" ] && [ "${OPTIONS[SOUNDMUTED]}" != -1 ]; then + MUTED="${OPTIONS[SOUNDMUTED]}" + fi # Write info file local UNAME= -- cgit v1.2.3-55-g7522