From 276370a1b1dfe49eda5765b19fcca15a2cc646e9 Mon Sep 17 00:00:00 2001 From: spl Date: Tue, 10 Jan 2017 18:15:43 +0000 Subject: [PATCH] Non-interactive setting of audio added. --- raspi-config | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/raspi-config b/raspi-config index 9781364..6ee809d 100755 --- a/raspi-config +++ b/raspi-config @@ -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