- Code: Select all
#! /bin/bash
for FILE in /mnt/MPD/Webradio/*.pls;
do
NAME=$(echo $FILE | grep -Po "(?<=/)[^/]+(?=\.)");
echo "station: $NAME";
URL=$(grep -Po "(?<=File1=).*$" "$FILE");
echo "url: $URL";
redis-cli hset "webradios" "${NAME}" "${URL}";
done;
mpc update webradio;
You can copy that into a file called "updateWebradios" in the /bin directory (/bin/updateWebradios) chmod it to 755 and then you can call it by just typing "updateWebradios" into the command line.
Or you can just copy that as one line into the command line and hit enter
- Code: Select all
for FILE in /mnt/MPD/Webradio/*.pls; do NAME=$(echo $FILE | grep -Po "(?<=/)[^/]+(?=\.)"); echo "station: $NAME"; URL=$(grep -Po "(?<=File1=).*$" "$FILE"); echo "url: $URL"; redis-cli hset "webradios" "${NAME}" "${URL}"; done; mpc update webradio;
After you have run the script you still have to go to "RESOURCES" and click "update MPD library" to get the stations visible. I am working on that...