Non-interactive setting of audio added.

This commit is contained in:
spl 2017-01-10 18:15:43 +00:00
parent 8555e8b524
commit 276370a1b1

View File

@ -1230,11 +1230,15 @@ do_update() {
}
do_audio() {
AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \
"0" "Auto" \
"1" "Force 3.5mm ('headphone') jack" \
"2" "Force HDMI" \
3>&1 1>&2 2>&3)
if [ "$INTERACTIVE" = True ]; then
AUDIO_OUT=$(whiptail --menu "Choose the audio output" 20 60 10 \
"0" "Auto" \
"1" "Force 3.5mm ('headphone') jack" \
"2" "Force HDMI" \
3>&1 1>&2 2>&3)
else
AUDIO_OUT=$1
fi
if [ $? -eq 0 ]; then
amixer cset numid=3 "$AUDIO_OUT"
fi