Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Shellscript depending on Status

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Sun Jul 19, 2009 6:28 am    Post subject: Shellscript depending on Status Reply with quote

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
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sun Jul 19, 2009 11:55 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Sun Jul 19, 2009 12:55 pm    Post subject: Reply with quote

Okay, but how can I parse the content in a shell?
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Sun Jul 19, 2009 1:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Mon Jul 20, 2009 6:06 am    Post subject: Reply with quote

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
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Jul 20, 2009 12:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
bbk



Joined: 15 Oct 2005
Posts: 79

PostPosted: Sun Jul 26, 2009 4:27 pm    Post subject: on connect script Reply with quote

i hope i am not totally off topic..

but could this post be a solution for your also.

i wrote these scripts for freebsd so they need to be changed for linux.

http://icecast.imux.net/viewtopic.php?t=2443
_________________
::bbk::

http://audioasyl.net
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber