I've updated the script and the awk program to only kill the desired qemu process. For this, I save the qemu process PID in a file named qemu.pid which is read by awk when a pattern matches.
The -x option is set on line 37 to avoid showing the trace of the option parsing commands. Do you want these commands to be also traced?
I've previously tried to do it this way. However, breaking the pipe is not sufficient for stopping the qemu process (or at least, not by exiting). I am reseraching why this happens.
Sorry that was an experiment I performed, there's no reason for that to be there... erasing it.
The reason I did it this way is to enable the possibility of adding new options to boot.sh in the future. Furthermore, the option of passing additional arguments to the qemu command is not erased.…