<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://www.linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Wed Jun 19, 2013 6:01 pm by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Wed Jun 19, 2013 6:01 pm</pubDate>
  <lastBuildDate>Wed Jun 19, 2013 6:01 pm</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://www.linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>Re: RE: Simple bash script.</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=25359#25359</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=7448'&gt;Steogede&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Jun 11, 2006 1:43 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;jmeads wrote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt;you just need to wrap it in a while loop, something like&lt;br /&gt;
&lt;br /&gt;
while 1&lt;br /&gt;
  command here&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
ugly, but it should do the trick, see man bash for more info&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;br /&gt;
&lt;br /&gt;
You probably want to don't want it to continually try to connect.  Shove a sleep command in there to give it a breather. e.g.&lt;br /&gt;
&lt;br /&gt;
while true; do&lt;br /&gt;
  command here;&lt;br /&gt;
  sleep 2m;&lt;br /&gt;
done;&lt;br /&gt;
&lt;br /&gt;
However that probably isn't what you want.  Re-executing 'xmms &lt;a href=&quot;http://192.168.0.3:9000/stream.mp3&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://192.168.0.3:9000/stream.mp3&lt;/a&gt;' ever time it fails to connect will leave you with lots of copies of xmms running.  When XMMS fails to connect, it doesn't shut down automatically.  Also because XMMS doesn't shutdown when it loses/fails to get a connection, the above would only run the command once;  until you manually closed xmms.&lt;br /&gt;
&lt;br /&gt;
It seems from searching the net, it seems the best option is probably to run a stream server on the local machine.  This server would relay the other server when it gets a connection and play a local file when it can't get a connection.  Try searching for stream relay.&lt;br /&gt;
&lt;br /&gt;
One more thing, if you are turning the server off at night, why would you want to keep the client on?&lt;br /&gt;
&lt;br /&gt;
You may also want to see if you can find a command line player that will exit if it loses/fails to get a connection - mpg321 might be upto the job.</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=25359#25359</comments>
                                        <author>Steogede</author>
                                        <pubDate>Sun Jun 11, 2006 1:43 pm</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=25359#25359</guid>
                                      </item>
                                      <item>
                                        <title>RE: Simple bash script.</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=25347#25347</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=4662'&gt;jmeads&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Jun 11, 2006 10:47 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      you just need to wrap it in a while loop, something like&lt;br /&gt;
&lt;br /&gt;
while 1&lt;br /&gt;
  command here&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
ugly, but it should do the trick, see man bash for more info</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=25347#25347</comments>
                                        <author>jmeads</author>
                                        <pubDate>Sun Jun 11, 2006 10:47 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=25347#25347</guid>
                                      </item>
                                      <item>
                                        <title>Simple bash script.</title>
                                        <link>http://www.linuxformat.com/forums/viewtopic.php?p=25346#25346</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://www.linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=6019'&gt;Xraynorm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Jun 11, 2006 9:56 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Hello&lt;br /&gt;
&lt;br /&gt;
I've built an wireless mp3 player out of an old compter using DSLiinux. When it boots it runs the command :-&lt;br /&gt;
&lt;br /&gt;
xmms &lt;a href=&quot;http://192.168.0.3:9000/stream.mp3&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://192.168.0.3:9000/stream.mp3&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
This connects to my server and plays my mp3s.&lt;br /&gt;
&lt;br /&gt;
I would like to write a script that re executes the above line if it fails to connect.&lt;br /&gt;
&lt;br /&gt;
This will enable me to turn off the main sever at night, and when I turn it back on the media player should reconnect automatically.&lt;br /&gt;
&lt;br /&gt;
Any help would be greatfully received</description>
                                        <comments>http://www.linuxformat.com/forums/viewtopic.php?p=25346#25346</comments>
                                        <author>Xraynorm</author>
                                        <pubDate>Sun Jun 11, 2006 9:56 am</pubDate>
                                        <guid isPermaLink="true">http://www.linuxformat.com/forums/viewtopic.php?p=25346#25346</guid>
                                      </item></channel></rss>