summaryrefslogtreecommitdiffstats
path: root/remote/modules/run-virt/data/opt
diff options
context:
space:
mode:
authorChristian Rößler2015-09-12 17:56:21 +0200
committerChristian Rößler2015-09-12 17:56:21 +0200
commitbea73fe4f0376b1689d6c8d079f1fdd768c90dec (patch)
treef592f8928d6b38e182d6db9029413fd1877ba8f6 /remote/modules/run-virt/data/opt
parent[runvirt] [vmware] Some more script cosmetics: "virtual machine description f... (diff)
downloadtm-scripts-bea73fe4f0376b1689d6c8d079f1fdd768c90dec.tar.gz
tm-scripts-bea73fe4f0376b1689d6c8d079f1fdd768c90dec.tar.xz
tm-scripts-bea73fe4f0376b1689d6c8d079f1fdd768c90dec.zip
[runvirt] Logging per writelog now has timestamp; sound setup: echo -> writelog
Diffstat (limited to 'remote/modules/run-virt/data/opt')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc16
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc4
2 files changed, 11 insertions, 9 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc
index 7b505474..201c0ff5 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_sound.inc
@@ -3,6 +3,8 @@
########################
# 8086:1e20: Sound card in bwPX4
+writelog "Starting sound setup ..."
+
if lspci -n | grep -E -i '8086:1e20( |$)'; then
VOL="100%" # bwPC 4: Speaker too quiet :-(
else
@@ -11,10 +13,10 @@ fi
if true; then
# detecting which card is to be used
- echo "Detecting which sound card to use ..."
+ writelog "Detecting which sound card to use ..."
PROC="/proc/asound/cards"
if [ ! -r "$PROC" ]; then
- echo "'${PROC}' not found or not readable."
+ writelog "'${PROC}' not found or not readable."
SOUND_CARD_INDEX=0
SOUND_CARD_COUNT=1
else
@@ -23,18 +25,18 @@ if true; then
# If empty, try again with all
[ -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."
+ writelog "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"
+ writelog "Detected sound card index is: $SOUND_CARD_INDEX"
+ writelog "Sound card count: $SOUND_CARD_COUNT"
# Adjust sound volume (playback)... Random mixer names we have encountered during testing
- echo "Setting up volume..."
+ writelog "Setting up volume..."
amixer -q -c "$SOUND_CARD_INDEX" sset 'Master' "$VOL" unmute
amixer -q -c "$SOUND_CARD_INDEX" sset 'PCM' "$VOL" unmute
amixer -q -c "$SOUND_CARD_INDEX" sset 'CD' "$VOL" unmute
@@ -58,5 +60,5 @@ if true; then
amixer -q -c "$SOUND_CARD_INDEX" sset 'Input Source' 'Front Mic' # Let's hope nobody uses rear mic...
# fix random static noise when starting vmplayer when module snd_pcsp (not pcspkr) is loaded
amixer -q -c pcsp sset Master "0%" mute
- echo "Done setting up volume."
+ writelog "Done setting up volume."
fi >> "${LOGFILE}" 2>&1
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc
index 7b64653c..a81b9309 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/vmchooser_runvirt_functions.inc
@@ -5,9 +5,9 @@
# function to write to stdout and logfile
writelog() {
# write to stdout
- echo -e "$1"
+ echo -e "$(date +%Y%m%d%H%M%S) $1"
# log into file
- echo -e "$1" >> "${LOGFILE}"
+ echo -e "$(date +%Y%m%d%H%M%S) $1" >> "${LOGFILE}"
}
# Clean exit will be called at the end of vmchooser-run_virt