|
Hey, sde.
I don't know about the screen thing, but you can put whatever you want in the grep. Another option is to start your jobs in the background:
(./hlds_run -game cstrike -port 27015 &)
...
Immediately after putting a job in the background, the process id is available in the shell variable $!
So you can do:
echo $! > hds_run1.pid
Your kill script would then do something like:
mykill hds_run1 ( or hds_run2, etc.)
mykill would look for the file name.pid, then do something like:
kill -9 `cat name.pid`
This should solve the problem of accidently killing other processes. If you include enough in grep to make it unique, you can accomplish the same thing, but the name.pid solution is probably a more generic solution.
|