Moode Forum

Full Version: Autoplay MusicRadioStation after disconnect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, there!
I'am from Germany and thats my first Post, and yes I love Moodeaudio.  Heart
First time i tried Volumio Rolleyes , but its to unstable for me.

My Idea
Problem: If Wlan disconnects, because Firmware Update, Internet disconnects or something other, the last played Radiostation will be not Autostart.
So it would be nice to have a feature do that auto. So the Radio plays continuously without hands.
Hey, one way to do that is to write a script in /etc/network/if-up.d/

It will trigger every time internet is up. With mpc you can do what you want.
Interesting, I didn't know that feature existed :-)
(10-26-2019, 02:33 PM)Tim Curtis Wrote: [ -> ]Interesting, I didn't know that feature existed :-)

Isn't the motto of Linux "Oh, yeah, that's in there too."
Hi and thx for Input,

i found this on a German Forum:

Code:
#!/bin/bash

mpc clear
sleep 2
mpc random off
mpc consume off
sleep 2
mpc load "Favorites"
sleep 10
mpc play

exit 0

 Added to /etc/network/ip-up.d
It's works manually, but NOT when I restart the Wifi connection. I have no clue  Confused
(10-28-2019, 05:43 PM)TheClaw Wrote: [ -> ]Hi and thx for Input,

i found this on a German Forum:

Code:
#!/bin/bash

mpc clear
sleep 2
mpc random off
mpc consume off
sleep 2
mpc load "Favorites"
sleep 10
mpc play

exit 0

 Added to /etc/network/ip-up.d
It's works manually, but NOT when I restart the Wifi connection. I have no clue  Confused

Try with #!/bin/sh instead #!/bin/bash

And chmod 755 on your script.

EDIT: It seems it only work when physical interface is activated (like pluging RJ45 cable, or activating wifi), but not reconnection.
So not good for your need.