newbie here.

I have a IP phone running busybox

I have obtained a script from the devs named avconv that can capture what is happening on the screen of the phone and to run it I use the following command

/data/avconv -f fbdev -r 25 -i /dev/fb0 /tmp/output.avi

When I m finished I hit Ctrl+C to stop the script.

Now I wanted to create a script that would run this command and then copy the output video to my tftp server. So I wrote the following which names the FileName with a date then runs the command and then the intention was to wait 5 seconds, find the pid (chop it to just keep the process ID), kill it and then send the FileName to my tftp..then delete the file..

FN=WE34_$(date +%Y%m%d-%H%M%S).avi
/data/avconv -f fbdev -r 25 -i /dev/fb0 /tmp/$FN
sleep 5
pid=`ps | grep avconv`
pidchopped=`echo $pid | cut -d' ' -f 1`
kill -5 $pidchopped
tftp -pl /tmp/$FN -r $FN
rm -f /tmp/$FN

the problem is that the command in the 2nd line of the script does not stop to to execute the rest of my script..could you please help me..any tip/hint/input will be highly appreciated..thank you in advance!!


It looks like you just need to run avconv in the background, rather than waiting for it, so the rest of your script can continue. Is that what you're looking for?

To do that, try adding & to the end of that line, like so:

/data/avconv -f fbdev -r 25 -i /dev/fb0 /tmp/$FN &
  • it worked Tim Perry Thanks a lot Apr 24 '20 at 16:46
  • i m sure there are smarter ways to run it and kill it but it works now when running in the background!!! thanks again Apr 24 '20 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.