summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmchooser2/data
diff options
context:
space:
mode:
authorSimon Rettberg2015-03-04 16:08:22 +0100
committerSimon Rettberg2015-03-04 16:08:22 +0100
commit2d7177a3710e791057c55f65bdcbe7d6012d214c (patch)
treeeaa853920bf046b965a7f6820c23a2530c008d89 /remote/modules/vmchooser2/data
parent[freiburg-config] sssd: etc/sssd/sssd.conf perms adjusted (or tried to) (diff)
downloadtm-scripts-2d7177a3710e791057c55f65bdcbe7d6012d214c.tar.gz
tm-scripts-2d7177a3710e791057c55f65bdcbe7d6012d214c.tar.xz
tm-scripts-2d7177a3710e791057c55f65bdcbe7d6012d214c.zip
[vm*] Only explicitly set sound card if there's more than one in the host system
Diffstat (limited to 'remote/modules/vmchooser2/data')
-rwxr-xr-xremote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt10
1 files changed, 6 insertions, 4 deletions
diff --git a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt
index 726c2340..d41bf564 100755
--- a/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt
+++ b/remote/modules/vmchooser2/data/opt/openslx/scripts/vmchooser-run_virt
@@ -445,24 +445,26 @@ fi
if true; then
# detecting which card is to be used
echo "Detecting which sound card to use ..."
- PROC="/proc/asound/cards"
+ PROC="/proc/asound/cards"
if [ ! -r "$PROC" ]; then
echo "'${PROC}' not found or not readable."
SOUND_CARD_INDEX=0
+ SOUND_CARD_COUNT=1
else
# Try to filter HDMI cards first
- SOUND_CARD_INDEX=$(grep -v -i 'HDMI' "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1)
+ SOUND_CARD_INDEX=$(grep -v -i 'HDMI' "${PROC}" | grep -E -o '^[[:space:]]{0,2}[0-9]+[[:space:]]+' | head -n 1)
# If empty, try again with all
- [ -z "${SOUND_CARD_INDEX}" ] && SOUND_CARD_INDEX=$(cat "${PROC}" | grep -E -o '^[[:space:]]*[0-9]+[[:space:]]+' | head -n 1)
-
+ [ -z "${SOUND_CARD_INDEX}" ] && SOUND_CARD_INDEX=$(cat "${PROC}" | grep -E -o '^[[:space:]]{0,2}[0-9]+[[:space:]]+' | head -n 1)
if [ -z "${SOUND_CARD_INDEX}" ]; then
echo "No sound card found."
SOUND_CARD_INDEX=0
fi
+ SOUND_CARD_COUNT=$(grep -E '^[[:space:]]{0,2}[0-9]+[[:space:]]+' "${PROC}" | wc -l)
fi
SOUND_CARD_INDEX="$(grep -E -o '[0-9]+' <<<$SOUND_CARD_INDEX)"
echo "Detected sound card index is: $SOUND_CARD_INDEX"
+ echo "Sound card count: $SOUND_CARD_COUNT"
# Adjust sound volume (playback)... Random mixer names we have encountered during testing
echo "Setting up volume..."