shell script - trap program termination
Hello All. I'm a newbie using the mldonkey software and find that it works well, but I've having trouble getting it (and other client/server type applications) to run without leaving a bunch of terminals on the screen (running the server, which I CTRL-C when I'm finished). It seems that I could write a shell script that runs the server, then the GUI and kills the server whenever I terminate the GUI.
I'd like to write a script like that but I don't know how tell when the GUI's been terminated. Could anyone direct me to a page with information like this? Is this even a plausible way to manage client/server applications on the same machine?
Thank you for your help!