Handle mixer controls with spaces
@@ -461,7 +461,7 @@ reconfigure_spotify() {
RESTART=0
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
- sed -i s/mixer\ =.*/mixer\ =\ $MIXER_CONTROL/ /etc/spotifyd.conf
+ sed -i "s/mixer\ =.*/mixer\ =\ $MIXER_SED_SPACES/" /etc/spotifyd.conf
RESTART=1
echo " updated mixer"
fi
@@ -486,7 +486,7 @@ reconfigure_vollibrespot() {
RESTART=0
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
- sed -i s/mixer-name\ =.*/mixer-name\ =\ \'$MIXER_CONTROL\'/ /etc/vollibrespot.conf
+ sed -i "s/mixer-name\ =.*/mixer-name\ =\ \'$MIXER_SED_SPACES\'/" /etc/vollibrespot.conf
RESTART=1
echo " updated mixer"
fi
@@ -517,7 +517,7 @@ reconfigure_shairport() {
RESTART=0
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
- sed -i s/mixer_control_name\ =\ .*/mixer_control_name\ =\ \"$MIXER_CONTROL\"\;/ /etc/shairport-sync.conf
+ sed -i "s/mixer_control_name\ =\ .*/mixer_control_name\ =\ \"$MIXER_SED_SPACES\"\;/" /etc/shairport-sync.conf
RESTART=1
echo " updated mixer"
fi
@@ -535,7 +535,7 @@ reconfigure_shairport() {
reconfigure_audiocontrol2() {
RESTART=0
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
- sed -i s/mixer_control.*=.*/mixer_control=$MIXER_CONTROL/ /etc/audiocontrol2.conf
+ sed -i "s/mixer_control=.*/mixer_control=$MIXER_SED_SPACES/" /etc/audiocontrol2.conf
RESTART=1
echo " updated mixer"
fi
@@ -592,7 +592,7 @@ reconfigure_dlna() {
fi
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
- sed -i "s/mixer\=.*/mixer=$MIXER_CONTROL/" /etc/dlnampris.conf
+ sed -i "s/mixer\=.*/mixer=$MIXER_SED_SPACES/" /etc/dlnampris.conf
UPDATE=1
fi
@@ -607,7 +607,7 @@ reconfigure_mpd() {
fi
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
- sed -i s/mixer_control\ .*/mixer_control\ \ \ \"$MIXER_CONTROL\"/ /etc/mpd.conf
+ sed -i "s/mixer_control\ .*/mixer_control\ \ \ \"$MIXER_SED_SPACES\"/" /etc/mpd.conf
restart_service mpd
echo " updated mixer"
fi
@@ -647,7 +647,7 @@ reconfigure_beocreate() {
# Update mixer control
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
- /bin/node /opt/beocreate/beo-system/configure.js sound mixer $MIXER_CONTROL
+ /bin/node /opt/beocreate/beo-system/configure.js sound mixer "$MIXER_CONTROL"
echo " updated mixer"
UPDATE=1
fi
@@ -726,6 +726,7 @@ check_pi3a
check_genuine
CARD_SED_SPACES=`echo $CARD | sed 's/\ /\\\\\\ /g' | sed 's/\//\\\\\\//g'`
+MIXER_SED_SPACES=`echo $MIXER_CONTROL | sed 's/\ /\\\\\\ /g' | sed 's/\//\\\\\\//g'`
FEATURES=`echo $FEATURES | xargs`
