Friday, May 27, 2016

Grab MPD status

Grab MPD status


install MPC
set bind address on mpd.conf to "0.0.0.0"

run command

echo "currentsong" | nc localhost 6600 | grep - e "^Title: " -e "^Name: "

echo "currentsong" | nc localhost 6600 | grep -e "^Name: "|cut -d: -f2
echo "currentsong" | nc localhost 6600 |grep -e "Name"|cut -d: -f2


example

root@OpenWrt:/mnt/data/mp3/slow# echo "currentsong" | nc localhost 6600 | grep -
e "^Title: " -e "^Name: "


Result
Title: Mark Blee - MOVIN' ON! 23.05.16 - Mark Blee - MOVIN' ON! 23.05.16
Name: SOULPOWER-RADIO.COM
root@OpenWrt:/mnt/data/mp3/slow#



No comments: