Monday, March 31, 2008

Simple Bash infinite loop

Sometimes , when I'm in despair and desparate mode , I like to hear the songs from various online radio streaming from Shoucast or Icecast , VLC video stream .

I'm not really a great music listener but it helps to reduce the tension i felt for the past few weeks.

I usually use the cli mplayer as my choice of client but due to some reasons sometimes your connection to the server will go down or in other words timed out. What annoys me most that the cli mplayer won't reconnect back. (Yeah i know we there are other clients like xmms,exaile,blax3 but so far only mplayer is the only client where i can use it on screen).

I found this to be very annoying and note down a simple infinite loop bash script.

while [ 1 ]
do
mplayer http://some.streamsite.com:8080/
done


And now i don't need to reconnect manually anymore. The infinite loop is also useful to maintain a non reliable ssh connection etcx3.

No comments: