Killing Bash Script Child Processes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kidko
    New Member
    • Apr 2007
    • 17

    Killing Bash Script Child Processes

    I've written a Zenity frontend for ffmpeg using a Bash script. However, if the user hits "cancel" in the progress dialog (incurring the --auto-kill option), the bash script is killed. Unfortunately, ffmpeg keeps running. How would one kill ffmpeg from within the script?

    In case it's needed, here is the line that calls both ffmpeg and Zenity:
    [php]ffmpeg -i "${vid}" -f mp4 -vcodec mpeg4 -qmax 7 -acodec aac -s 320x240 -aspect $aspect "${vid}.mp4 " | zenity --progress --title "Conversion In Progress" --text "Converting $vid to iPod-formatted MP4.\n\nNOTE: Closing this window will not harm your conversion. To kill the process, go the the console window and press Ctrl-C" --pulsate --auto-close --auto-kill[/php]
Working...