sxmo_audio*: properly set vars with default values if they are unset
A mistake from implementing this resulted in the shell trying to expand the 'word' part (e.g. "Line Out"), when the var was unset or null. Obviously those are are strings and not expandable. Signed-off-by: Anjandev Momi <anjan@momi.ca>
这个提交存在于:
父节点
7d9b86b54c
当前提交
2d9740f252
共有 2 个文件被更改,包括 6 次插入 和 6 次删除
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env sh
|
||||
${SPEAKER:-"Line Out"}
|
||||
${HEADPHONE:-"Headphone"}
|
||||
${EARPIECE:-"Earpiece"}
|
||||
SPEAKER=${SPEAKER:-"Line Out"}
|
||||
HEADPHONE=${HEADPHONE:-"Headphone"}
|
||||
EARPIECE=${EARPIECE:-"Earpiece"}
|
||||
|
||||
audiodevice() {
|
||||
amixer sget "$EARPIECE" | grep -qE '\[on\]' && echo "$EARPIECE" && return
|
||||
|
|
|
@ -5,9 +5,9 @@ ARG="$1"
|
|||
# shellcheck source=scripts/core/sxmo_common.sh
|
||||
. "$(dirname "$0")/sxmo_common.sh"
|
||||
|
||||
${SPEAKER:-"Line Out"}
|
||||
${HEADPHONE:-"Headphone"}
|
||||
${EARPIECE:-"Earpiece"}
|
||||
SPEAKER="${SPEAKER:-"Line Out"}"
|
||||
HEADPHONE="${HEADPHONE:-"Headphone"}"
|
||||
EARPIECE="${EARPIECE:-"Earpiece"}"
|
||||
|
||||
amixer set "$SPEAKER" mute
|
||||
amixer set "$HEADPHONE" mute
|
||||
|
|
正在加载…
添加表格
添加链接
在新工单中引用