In the startup script use a function for getting PIDs
This makes the stop/restart section a lot more readable