plugctl -n 1 oPCR[0].channel=1
plugctl -n 2 oPCR[0].channel=2

DONE=no
i="/root/foo.mpg"
while [ "$DONE" = "no" ]
do
if [ -s $i ]
then
echo file size exists!!!!
DONE=yes
echo connection with firewire complete
        break
else
# Sets the plug to deactive/active to jog it to life. This can sometimes require multiple.
# Eventually it shall catch and will move onto next section below.
plugctl -n 1 oPCR[0].n_p2p_connections=0
plugctl -n 1 oPCR[0].n_p2p_connections=1
echo test.mpg is empty or does not exist resetting to try again.
test-mpeg2 -r 1 > /root/foo.mpg & sleep 3 ; kill $!
fi
done

rm /root/foo.mpg
DONE=no
i="/root/foo.mpg"
while [ "$DONE" = "no" ]
do
if [ -s $i ]
then
echo file size exists!!!!
DONE=yes
echo connection with firewire complete
else
plugctl -n 2 oPCR[0].n_p2p_connections=0
plugctl -n 2 oPCR[0].n_p2p_connections=1
echo test.mpg is empty or does not exist resetting to try again.
test-mpeg2 -r 2 > /root/foo.mpg & sleep 3 ; kill $!
fi
done

