| View previous topic :: View next topic |
| Author |
Message |
ZeroEnna
Joined: 18 Jul 2009 Posts: 10
|
Posted: Sun Jul 19, 2009 6:28 am Post subject: Shellscript depending on Status |
|
|
Hi there,
first of all: I totally like Icecast and I think this is a big piece of ingenious software.
Now, I have a question concerning the config:
I use Icecast 2.3.2 and Ices2 on an Ubuntu 8.04 server.
Now, I have a problem that one off my DJs needs an MP3 mount point. I installed the OddSock Streamtranscoder. Now here is the tricky part.
The Transcoder is only to start when the MP3 stream/mount point is up.
Now how can I check the status of one single mountpoint in a linux shell script?
Please help me
Greets
ZeroEnna |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Jul 19, 2009 11:55 am Post subject: |
|
|
write a custom xsl file, like status2.xsl which will output something which is easy to parse, say a single word like active and the shell script can use wget or curl to retrieve the xsl contents.
karl. |
|
| Back to top |
|
 |
ZeroEnna
Joined: 18 Jul 2009 Posts: 10
|
Posted: Sun Jul 19, 2009 12:55 pm Post subject: |
|
|
| Okay, but how can I parse the content in a shell? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sun Jul 19, 2009 1:02 pm Post subject: |
|
|
using sh, untested but something like
res=`curl -s 'http://host:8000/streamstatus.xsl?mount=/live.ogg'`
if [ "$res" = "active" ]; then
# do something
fi
as I said, make it really simple to parse, it does not have to be xml output
karl. |
|
| Back to top |
|
 |
ZeroEnna
Joined: 18 Jul 2009 Posts: 10
|
Posted: Mon Jul 20, 2009 6:06 am Post subject: |
|
|
One last (n00b) question:
How can I set what is written into the xsl file? As you said, e.g. just a single word or so. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Mon Jul 20, 2009 12:12 pm Post subject: |
|
|
the xsl files are just text, have a look in your webroot directory to see the existing xsl files. You may find status2.xsl better suited to your situation.
karl. |
|
| Back to top |
|
 |
bbk

Joined: 15 Oct 2005 Posts: 79
|
|
| Back to top |
|
 |
|