-
-
Save bonelifer/0c2a40bce71da70b3b6839c6182a5e92 to your computer and use it in GitHub Desktop.
Update/Create ALSA config file with updated BD_ADDR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Update alsa config file with new BD_ADDR | |
# Backup original | |
# Create a new config file if one doesn't exist | |
usage() { | |
echo "Usage: $0 xx:xx:xx:xx:xx:xx" | |
} | |
[ $# -ne 1 ] && usage && exit 1 | |
RC=~/.asoundrc | |
[ -f ${RC} ] && sed -i.orig '/^defaults.bluealsa.device/s/".*"/"'${1}'"/g' ${RC} || cat > ${RC} <<EOF | |
defaults.bluealsa.interface "hci0" | |
defaults.bluealsa.device "${1}" | |
defaults.bluealsa.profile "a2dp" | |
defaults.bluealsa.delay 10000 | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment