Skip to content

Instantly share code, notes, and snippets.

@arne123
Last active January 14, 2021 19:05
Show Gist options
  • Save arne123/b35126771ffe19d73910c83d182ed0b9 to your computer and use it in GitHub Desktop.
Save arne123/b35126771ffe19d73910c83d182ed0b9 to your computer and use it in GitHub Desktop.
recompiled mpd with less shared libs, startsound in parallel to mpd
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
# The absolute path to the folder whjch contains all the scripts.
# Unless you are working with symlinks, leave the following line untouched.
PATHDATA="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
###########################################################
# Read global configuration file (and create is not exists)
# create the global configuration file from single files - if it does not exist
if [ ! -f $PATHDATA/../settings/global.conf ]; then
. /home/pi/RPi-Jukebox-RFID/scripts/inc.writeGlobalConfig.sh
fi
. $PATHDATA/../settings/global.conf
###########################################################
echo "Phoniebox is starting..."
cat $PATHDATA/../settings/version-number
cat $PATHDATA/../settings/global.conf
echo "${AUDIOVOLSTARTUP} is the mpd startup volume"
####################################
# make playists, files and folders
# and shortcuts
# readable and writable to all
sudo chmod -R 777 ${AUDIOFOLDERSPATH}
sudo chmod -R 777 ${PLAYLISTSFOLDERPATH}
sudo chmod -R 777 $PATHDATA/../shared/shortcuts
#########################################
# wait until mopidy/MPD server is running
STATUS=0
while [ "$STATUS" != "ACTIVE" ]; do STATUS=$(echo -e status\\nclose | nc -w 0 localhost 6600 | grep 'OK MPD'| sed 's/^.*$/ACTIVE/'); done
####################################
# check if and set volume on startup
/home/pi/RPi-Jukebox-RFID/scripts/playout_controls.sh -c=setvolumetostartup
####################
# play startup sound
#mpgvolume=$((32768*${AUDIOVOLSTARTUP}/100))
#echo "${mpgvolume} is the mpg123 startup volume"
#/usr/bin/mpg123 -f -${mpgvolume} /home/pi/RPi-Jukebox-RFID/shared/startupsound.mp3
#######################
# re-scan music library
#mpc rescan
#######################
# read out wifi config?
if [ "${READWLANIPYN}" == "ON" ]; then
/home/pi/RPi-Jukebox-RFID/scripts/playout_controls.sh -c=readwifiipoverspeaker
fi
#!/bin/bash
#sleep 1.5
####################
# play startup sound
mpgvolume=$((32768*50/100))
echo "${mpgvolume} is the mpg123 startup volume"
/usr/bin/mpg123 -f -${mpgvolume} /home/pi/RPi-Jukebox-RFID/shared/startupsound.mp3
#######################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment