Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
install.log
install_choices
backup_files/
install
installed_deps

# following entries are for libs/apps that will be compiled during setup
json-c/
libsndfile/
pulseaudio/
4 changes: 2 additions & 2 deletions bt_pa_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exc sudo chmod +x /etc/init.d/bluetooth
exc sudo update-rc.d bluetooth defaults

save_original /etc/init.d/bluetooth-agent
if [ "$VOL_USER" = "\"arm\"" ]
if [ "$VOL_USER" = '"arm"' ] # using '"arm"' instead of "\"arm\"" helps with syntax highlighting
then
exc sudo cp init.d/bluetooth-agent-vol /etc/init.d/bluetooth-agent
else
Expand Down Expand Up @@ -120,7 +120,7 @@ exc sudo patch /etc/bluetooth/main.conf << EOT
*** 7,8 ****
--- 7,9 ----
#Name = %h-%d
+ Name = ${BT_NAME}
+ Name = ${BluetoothName} # the var is called 'BluetoothName' instead of 'BT_NAME'

***************
*** 11,12 ****
Expand Down
25 changes: 23 additions & 2 deletions functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ run(){
}
exc(){
log Executing $*
$* &> /dev/null
verify "'$*' failed"
output=`$* 2>&1`
# add additional helpful information in case we run into errors
verify "'$*' failed"'\n'"More Information:"'\n'"Current user and dir: `whoami`, `pwd`"'\n'"Output:"'\n'"$output"
}
apt_update() {
log Updating via $*...
Expand Down Expand Up @@ -106,6 +107,26 @@ restore_originals(){
fi

}
restore_original() {
if [ -e "$1" ]; then
if [ -d "$1" ]; then
log "$1 is a directory"
else
FILE=`echo $1 | sed "s/.*\///"`
echo $FILE
LOC="$SSPARI_BACKUP_PATH/$FILE"
if [ -e "$LOC" ]; then
log "File "$FILE" has been previously backed up, restoring..."
LINE=`grep -e "^$FILE=" $SSPARI_BACKUP_PATH/files`
DIR=`echo $LINE | sed "s/^$FILE=//"`
cp $SSPARI_BACKUP_PATH/$FILE $DIR/$FILE
sed -i "/^$FILE=/d" $SSPARI_BACKUP_PATH/files
else
log "File $FILE is not included in backup!"
fi
fi
fi
}
save_original(){
if [ -e "$1" ]; then
if [ -d "$1" ]; then
Expand Down
Empty file modified init.d/bluetooth-agent-vol
100644 → 100755
Empty file.
9 changes: 6 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ then
export BluetoothName
run ./bt_pa_install.sh
VOL_USER=`cat /etc/os-release | grep VOLUMIO_ARCH | sed "s/VOLUMIO_ARCH=//"`
if [ "$VOL_USER" = "\"arm\"" ]
if [ "$VOL_USER" = '"arm"' ] # using '"arm"' instead of "\"arm\"" helps with syntax highlighting
then
export VOL_USER
apt-get purge bluez -y
Expand All @@ -288,9 +288,12 @@ then
sed -i "s/$user ALL=(ALL) NOPASSWD: ALL/$user ALL=(ALL) ALL/" /etc/sudoers
for _dep in ${vol_groups[@]}; do sudo usermod -aG "$_dep" volumio; done
else
run su ${user} -c ./bt_pa_config.sh
save_original /etc/sudoers
# allow $user everything without password
echo "$user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
run su ${user} -c ./bt_pa_config.sh
restore_original /etc/sudoers
#for _dep in ${vol_groups[@]}; do usermod -aG "$_dep" $user; done


fi

Expand Down