summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--music_status.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/music_status.sh b/music_status.sh
new file mode 100644
index 0000000..ef468df
--- /dev/null
+++ b/music_status.sh
@@ -0,0 +1,12 @@
+#Script that writes the current mpd status
+#To be called by a remote device
+SSH_HOST="localhost"
+STATUS=$(mpc status | grep paused)
+REMOTE_PORT_COMMAND='(arduino-cli board list | grep dev | grep -o '^\S*')'
+if [ -z $STATUS ] #not paused
+then
+ SONG=$(mpc current)
+ ssh $SSH_HOTS "echo m$SONG > $REMOTE_PORT_COMMAND"
+else #paused
+ ssh $SSH_HOST "echo mPAUSED > $REMOTE_PORT_COMMAND"
+fi