[icecast] capturing pid from command line

Dave St John groups at mediacast1.com
Tue Nov 4 07:06:09 UTC 2003



works sorda,
albeit this is what it spits out when capturing it to a file with the
following bash script

---------------------------------
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:
export PATH

cd /usr/local/icecast2
echo "List of servers to work with"

cat ./servers.txt

printf "Please enter which server to start:"
read answer
printf "\n"

nohup bin/icecast -b -c servers/$answer > /dev/null 2>&1 &

<p>PID=`ps -auxw | fgrep icecast | fgrep -v fgrep | awk '{print$2}'`
echo "$PID - $answer" | tee pids/$answer.txt

pits out this
10470
10481
10494
10511
10526
10544
10560
10575
10590
10607
10622
10639
10656
10671
10690
10707
10724
10741
10758
10775
10792
10809 - 8000-oggv5-testaccount.xml

the last one being the correct pid, the reasone its spitting out all those
other pids is because im starting multiple config files and its capturing
all,
so any idea on how to just capture the parent pid to a file?

<p><p><p>Dave St John
(CEO) Mediacast1.com
----- Original Message ----- 
From: "Adon Irani" <adon at yorku.ca>
To: <icecast at xiph.org>
Sent: Monday, November 03, 2003 11:01 PM
Subject: Re: [icecast] capturing pid from command line

<p>>
> hello ;
>
> can't recall where i got it from , but this should work .,
>
> ps auxw | fgrep icecast | fgrep -v fgrep | awk '{print $2}'
>
>  a:/,
>
>
> On Mon, 3 Nov 2003, Dave St John wrote:
>
> > Anyone know of or how to capture the pid via the command line in bash?
> >
> > i.e. i use this to capture shoutcast's process id
> > #!/bin/bash
> > SRV=`cat serverlst.txt`
> >
> > rm -rf pids/*
> >
> >
> > for c in $SRV ; do
> >
> > nohup ./sc_serv servers/$c > /dev/null 2>&1 &
> >
> > echo "$! - $c" | tee pids/$c.pid
> >
> > done
> >
> > that works successfully with shoutcast but not with icecast2, ideas
anyone?
> >
> >
> > Dave St John
> > (CEO) Mediacast1.com
> >
> >
> > --- >8 ----
> > List archives:  http://www.xiph.org/archives/
> > icecast project homepage: http://www.icecast.org/
> > To unsubscribe from this list, send a message to
'icecast-request at xiph.org'
> > containing only the word 'unsubscribe' in the body.  No subject is
needed.
> > Unsubscribe messages sent to the list will be ignored/filtered.
> >
> --- >8 ----
> List archives:  http://www.xiph.org/archives/
> icecast project homepage: http://www.icecast.org/
> To unsubscribe from this list, send a message to
'icecast-request at xiph.org'
> containing only the word 'unsubscribe' in the body.  No subject is needed.
> Unsubscribe messages sent to the list will be ignored/filtered.
>

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Icecast mailing list