[icecast] capturing pid from command line

Dave St John
Fri, 06 Aug 2004 14:23:35 -0000

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