This script is 'set -e', which means that it will halt at the first error. Since killing processes using the KILL signal is something that could fail (you never know, the process might have halted itself before you sent the signal, etc...), I suggest placing these "rm" commands *above* the kill commands. That way, we are sure to always remove the broken DB files, then we try to kill the processes.