Skip to content

Commit

Permalink
Release 2022-04-09
Browse files Browse the repository at this point in the history
  • Loading branch information
GioF71 committed Apr 9, 2022
1 parent 6e99f26 commit 4ac5c60
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,6 @@ Just be careful to use the tag you have built.

Release Date|Major Changes
:---|:---
2022-04-09|Removed redundancies in start script
2022-04-09|mpd-base-image recently bumped
2022-04-08|Initial release
4 changes: 2 additions & 2 deletions app/assets/mpd-template.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
music_directory "/music"
playlist_directory "/playlists"
db_file "/db/tag_cache"
db_file "/db/tag_cache"
state_file "/db/state"
sticker_file "/db/sticker"
user "root"
bind_to_address "127.0.0.1"
bind_to_address "127.0.0.1"

input {
plugin "curl"
Expand Down
21 changes: 13 additions & 8 deletions app/bin/run-mpd.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash

ASSETS_PATH=/app/assets
PLAYLIST_FILE_NAME=radio.m3u
MPD_CONFIG_FILE=/etc/mpd-radio-streamer.conf
PLAYLIST_FILE=/app/assets/radio.m3u
PLAYLIST_BUILD_FULL_PATH="$ASSETS_PATH/$PLAYLIST_FILE_NAME"
PLAYLIST_PATH=/playlists

echo "PLAYLIST_BUILD_FULL_PATH = [$PLAYLIST_BUILD_FULL_PATH]"

cat /app/assets/mpd-template.conf > $MPD_CONFIG_FILE

Expand Down Expand Up @@ -54,15 +59,15 @@ echo "About to sleep for $STARTUP_DELAY_SEC second(s)"
sleep $STARTUP_DELAY_SEC

echo "Creating playlist file"
echo $MPD_RADIO_STREAMER_URL#$radio_name > $PLAYLIST_FILE
chmod 644 $PLAYLIST_FILE
echo $MPD_RADIO_STREAMER_URL#$radio_name > $PLAYLIST_BUILD_FULL_PATH
chmod 644 $PLAYLIST_BUILD_FULL_PATH

echo "Config file [$MPD_CONFIG_FILE]"
cat $MPD_CONFIG_FILE

cp $PLAYLIST_FILE /playlists
echo "Playlist"
cat /playlists/radio.m3u
cp $PLAYLIST_BUILD_FULL_PATH $PLAYLIST_PATH
echo "Playlist:"
cat $PLAYLIST_PATH/$PLAYLIST_FILE_NAME

echo "Ready to start."
/usr/bin/mpd $MPD_CONFIG_FILE
Expand All @@ -80,9 +85,9 @@ echo "Press [CTRL+C] to stop..."
counter=0
while true
do
counter=counter+1
counter=counter+1
if ! mpc status | awk 'NR==2' | grep playing > /dev/null; then
mpc play
fi
sleep 5
sleep 5
done

0 comments on commit 4ac5c60

Please sign in to comment.