Hi,<br>I was wondering if anybody could help me write a bash script that I could call say 'ardour2mmc' that would launch ardour and then run aconnect to connect the midi ports to my hardware, and then once ardour quit, disconnect the ports.  I know the commands needed, but not sure how to make the script wait for ardour to close before issuing the disconnect commands.  I guess some kind of 'if then' or 'while' loop is what's needed, but I have no idea how to make that work.  The aconnect commands I need are as follows
<br>when ardour/ardour2 launches<br>aconnect -e 129:0 16:0 & acconect -e 16:0 129:0<br>then when it quits<br>aconnect -d 129:0 16:0 & aconnect -d 16:0 129:0<br><br>Thanks,<br><br>Andy J<br><br><br>