File [scripts/mpd_track_list.sh]
| 1 |
#!/bin/bash |
| 2 |
if [ $# -eq 0 ]; then |
| 3 |
echo "usage $0 host" |
| 4 |
exit 1 |
| 5 |
fi |
| 6 |
# Define the path and any password options for MPD |
| 7 |
MY_MPC="/usr/bin/mpc -h $1" |
| 8 |
# Check if the server is up and running |
| 9 |
ping -c 2 -W 1 $1 2>&;1>/dev/null |
| 10 |
if [ $? -eq 0 ]; then |
| 11 |
# Define acceptable genres of random tracks to add |
| 12 |
MY_GENRES="Dance Electronica Folk Funk Indie Jazz Pop |
| 13 |
Reggae Rock Soul Soundtrack" |
| 14 |
# Define Anything to strip out |
| 15 |
MY_STRIP="Wiggles Fuck Shit" |
| 16 |
# Remove the track list file if it exists |
| 17 |
rm -f /tmp/random_mpd_tracks.txt |
| 18 |
for genre in ${MY_GENRES} |
| 19 |
do |
| 20 |
$MY_MPC search genre ${genre} >> /tmp/random_mpd_tracks.txt |
| 21 |
done |
| 22 |
for strip in ${MY_STRIP} |
| 23 |
do |
| 24 |
grep -v -i ${strip} /tmp/random_mpd_tracks.txt > /tmp/random_mpd_tracks_out.txt |
| 25 |
mv /tmp/random_mpd_tracks_out.txt /tmp/random_mpd_tracks.txt |
| 26 |
done |
| 27 |
fi |



![Validate my Atom 1.0 feed [Valid Atom 1.0]](./images/valids/valid-atom10-yellow.gif)
![Validate my RSS 2.0 feed [Valid RSS 2.0]](./images/valids/valid-rss20-yellow.gif)